Multiplexer and multiplexing method, program, and recording medium

ABSTRACT

The present invention relates to a multiplexer, a multiplexing method, a program, and a recording medium, whereby TS packets encoded with different encoding methods can be multiplexed. In the event of multiplexing each TS packet of a BS audio TS  173  wherein a BS audio ES  171  encoded with a first encoder is subjected to TS packetizing, and each TS packet of an HQ audio TS  183  wherein an HQ audio ES  181  encoded with a second encoder is subjected to TS packetizing, a control unit assumes a first virtual decoder capable of decoding a BS audio ES alone, and a second virtual decoder capable of decoding an HQ audio ES alone, and determines TS packets to be multiplexed based on an elementary buffer of each virtual decoder, a data transfer rate for the elementary buffer, and multiplexing constraints for random access. The present invention can be applied to a multiplexer configured to multiplex TS packets.

CROSS REFERENCE TO RELATED APPLICATIONS

This application is a Continuation Application of U.S. Ser. No.11/911,666 filed Oct. 16, 2007, the entire content of which isincorporated herein by reference. U.S. Ser. No. 11/911,666 is a NationalStage of PCT/JP06/308298 filed Apr. 20, 2006, and claims priority toJapanese Application No. 2005-125546 filed Apr. 22, 2005.

TECHNICAL FIELD

The present invention relates to a multiplexer and a multiplexingmethod, a program, and a recording medium, and particularly relates to amultiplexer and a multiplexing method, a program, and a recordingmedium, whereby TS packets of audio streams encoded with differentencoding methods can be multiplexed.

BACKGROUND ART

In the event of subjecting a video stream or audio stream to TS(Transport Stream) packetizing and multiplexing using the MPEG (MovingPicture Expert Group) method, a standard model (system target decoder(STD)) serving as a decoder is assumed, and encoding processing isperformed so as to perform decoding processing correctly with this STD.

For example, with Patent Document 1, technology has been disclosedwherein, assuming an STD model shown in FIG. 2, an encoding apparatussuch as shown in FIG. 1 subjects an elementary stream to TS packetizingto generate an MPEG transport stream.

The encoding apparatus shown in FIG. 1 comprises an access unit detector1, a pseudo-access-unit calculator 2, a packetizer 3, and a scheduler 4.Also, the STD model shown in FIG. 2 comprises a previous-stage buffer21, a subsequent-stage buffer 22, and a decoder 23.

The access unit detector 1 of the encoding apparatus obtains an accessunit from an elementary stream, and detects the size and decodingpoint-in-time information of the access unit thereof. When dividing anaccess unit into pseudo-access units having a predetermined sizedepending on the size of the previous-stage buffer 21 shown in FIG. 2,and a data transfer rate as to the previous-stage buffer 21, thepseudo-access-unit calculator 2 calculates point-in-time when thepseudo-access unit thereof is input to the previous-stage buffer 21(input completed point-in-time) (decoded point-in-time of thepseudo-access unit). The scheduler 4 calculates point-in-time when amultiplexed stream is supplied to the decoder (clock reference) and thesize of a packet (packet size) based on the size of the pseudo-accessunit and the pseudo-decoding point-in-time.

The packetizer 3 packetizes the elementary stream in accordance with thepacket size, encodes the decoded point-in-time and the clock reference,and generates an MPEG transport stream. The generated MPEG transportstream is sent via a transmission path 5, or recorded in a recordingmedium 5.

Incidentally, in the event of subjecting an audio stream to TSpacketizing using the MPEG method, and multiplexing the packetized TSpackets into one transport stream, the audio stream thereof has beenalready encoded with a predetermined encoding method beforehand.Examples of this encoding method include a fixed-length encoding methodand a variable-length encoding method.

Consequently, a situation can be conceived wherein two audio streamsencoded with different encoding methods are multiplexed into onetransport stream.

[Patent Document 1] Japanese Unexamined Patent Application PublicationNo. 9-261604

DISCLOSURE OF INVENTION Problems to be Solved by the Invention

However, a situation wherein two audio streams encoded with differentencoding methods are packetized to TS packets having the same PID, andmultiplexed, has not been assumed with the STD model such as shown inFIG. 2, so it has been difficult to packetize two audio streams encodedwith different encoding methods to TS packets having the same PID, andmultiplex the TS packets having the same PID into one transport stream.

The present invention, which has been made in light of such a situation,multiplexes the TS packets of two audio streams encoded with differentencoding methods into one transport stream.

A multiplexer according to the present invention comprises: firstencoding means configured to encode audio data using a first encodingmethod serving as a predetermined encoding method; second encoding meansconfigured to encode the audio data using a second encoding method,which is a variable-length encoding method, and also differs from thefirst encoding method, arranged to add a timing value representingtiming employed for a case of being decoded to each predetermined audiodata unit; PES packetizing means configured to packetize the audio dataencoded by the first encoding means, and the audio data encoded by thesecond encoding means to a PES packet, and also add point-in-timeinformation employed for a case of being decoded to a plurality of thepacketized PES packets; TS packetizing means configured to packetize thePES packet PES-packetized by the PES packetizing means to a TS packet,and also add the same ID to a plurality of the packetized TS packets;determining means configured to determine TS packets to be multiplexedfrom a plurality of the TS packets packetized by the TS packetizingmeans; and multiplexing means configured to multiplex the TS packetsdetermined by the determining means; wherein the PES packetizing meanspacketize the audio data encoded by the first encoding means, and theaudio data encoded by the second encoding means to a PES packet suchthat the audio data unit satisfying a predetermined cycle appears at thehead of a PES payload; and wherein the determining means is configuredto assume a first virtual decoder configured to decode the audio dataencoded by the first encoding means, and a second virtual decoderconfigured to decode the audio data encoded by the second encoding meansbased on the timing value added to the audio data encoded by the secondencoding means, and also determine TS packets to be multiplexed based onmultiplexing constraints arranged to randomly access the multiplexed TSpackets.

The determining means can be configured to determine TS packets to bemultiplexed from a plurality of the TS packets packetized by the TSpacketizing means based on a first elementary buffer included in thefirst virtual decoder and a data transfer rate as to the firstelementary buffer, and a second elementary buffer included in the secondvirtual decoder and a data transfer rate as to the second elementarybuffer.

The determining means can be configured to determine TS packets to bemultiplexed from a plurality of the TS packets packetized by the TSpacketizing means while causing the first elementary buffer included inthe first virtual decoder, and the second elementary buffer included inthe second virtual decoder to neither overflow nor underflow.

The multiplexer according to the present invention can be configured tofurther comprise recording means configured to record the TS packetsmultiplexed by the multiplexing means in a recording medium.

The audio data unit can be arranged to be an audio access unit.

The first virtual decoder can be configured to include a transportbuffer at the previous stage of the first elementary buffer, and thesecond virtual decoder can be configured to include a transport bufferat the previous stage of the second elementary buffer, and also includea third elementary buffer at the subsequent stage of the secondelementary buffer.

The determining means can be configured to determine TS packets to bemultiplexed from a plurality of the TS packets packetized by the TSpacketizing means, assuming that input timing as to the third elementarybuffer is timing as to the timing value.

The timing value can be arranged to be a value represented with asampling cycle of audio information at which the audio stream unit istransmitted to the third elementary buffer.

The PES packetizing means can be configured, in the event of subjectingthe audio data encoded by the second encoding means to PES packetizing,to packetize the audio data encoded by the second encoding means suchthat the audio data unit satisfying the cycle, and including decodinginformation to start decoding from that position appears at the head ofa PES payload.

The multiplexing constraints are constraints in which in the event thata TS includes a TS packet of audio data encoded by the second encodingmeans having the same point-in-time information as the point-in-timeinformation included in a TS packet of audio data encoded by the firstencoding means, the TS packet of the audio data encoded by the firstencoding means is multiplexed prior to the TS packet of the audio dataencoded by the second encoding means, and the determining means can beconfigured to determine TS packets to be multiplexed based on theassumptions of the first virtual decoder and the second virtual decoder,and the multiplexing constraints.

A multiplexing method according to the present invention comprises: afirst encoding step arranged to encode audio data using a first encodingmethod serving as a predetermined encoding method; a second encodingstep arranged to encode the audio data using a second encoding method,which is a variable-length encoding method, and also differs from thefirst encoding method, arranged to add a timing value representingtiming employed for a case of being decoded to each predetermined audiodata unit; a PES packetizing step arranged to packetize the audio dataencoded by the processing in the first encoding step, and the audio dataencoded by the processing in the second encoding step to a PES packet,and also add point-in-time information employed for a case of beingdecoded to a plurality of the packetized PES packets; a TS packetizingstep arranged to packetize the PES packet PES-packetized by theprocessing in the PES packetizing step to a TS packet, and also add thesame ID to a plurality of the packetized TS packets; a determining steparranged to determine TS packets to be multiplexed from a plurality ofthe TS packets packetized by the processing in the TS packetizing step;and a multiplexing step arranged to multiplex the TS packets determinedby the processing in the determining step; wherein with the processingin the PES packetizing step, the audio data encoded by the processing inthe first encoding step, and the audio data encoded by the processing inthe second encoding step is packetized to a PES packet such that theaudio data unit satisfying a predetermined cycle appears at the head ofa PES payload; and wherein the processing in the determining step isarranged to assume a first virtual decoder configured to decode theaudio data encoded by the processing in the first encoding step, and asecond virtual decoder configured to decode the audio data encoded bythe processing in the second encoding step based on the timing valueadded to the audio data encoded by the processing in the second encodingstep, and also determine TS packets to be multiplexed based onmultiplexing constraints arranged to randomly access the multiplexed TSpackets.

A program according to the present invention arranged to control acomputer to execute processing including: a first encoding step arrangedto encode audio data using a first encoding method serving as apredetermined encoding method; a second encoding step arranged to encodethe audio data using a second encoding method, which is avariable-length encoding method, and also differs from the firstencoding method, arranged to add a timing value representing timingemployed for a case of being decoded to each predetermined audio dataunit; a PES packetizing step arranged to packetize the audio dataencoded by the processing in the first encoding step, and the audio dataencoded by the processing in the second encoding step to a PES packet,and also add point-in-time information employed for a case of beingdecoded to a plurality of the packetized PES packets; a TS packetizingstep arranged to packetize the PES packet PES-packetized by theprocessing in the PES packetizing step to a TS packet, and also add thesame ID to a plurality of the packetized TS packets; a determining steparranged to determine TS packets to be multiplexed from a plurality ofthe TS packets packetized by the processing in the TS packetizing step;and a multiplexing step arranged to multiplex said TS packets determinedby the processing in the determining step; wherein with the processingin the PES packetizing step, the audio data encoded by the processing inthe first encoding step, and the audio data encoded by the processing inthe second encoding step is packetized to a PES packet such that theaudio data unit satisfying a predetermined cycle appears at the head ofa PES payload; and wherein the processing in the determining step isarranged to assume a first virtual decoder configured to decode theaudio data encoded by the processing in the first encoding step, and asecond virtual decoder configured to decode the audio data encoded bythe processing in the second encoding step based on the timing valueadded to the audio data encoded by the processing in the second encodingstep, and also determine TS packets to be multiplexed based onmultiplexing constraints arranged to randomly access the multiplexed TSpackets.

According to a first aspect of the present invention, the audio dataencoded with the first encoding method, and the audio data encoded withthe second encoding method are packetized to a PES packet, and alsopoint-in-time information employed for a case of being decoded is addedto a plurality of the packetized PES packets, and the PES packets arepacketized to TS packets, and also the same ID is added to a pluralityof the TS packets. Also, TS packets to be multiplexed are determinedfrom a plurality of the TS packets, and the determined TS packets aremultiplexed. The audio data encoded with the first encoding method, andthe audio data encoded with the second encoding method are packetized toPES packets such that the audio data unit satisfying a predeterminedcycle appears at the head of a PES payload. Further, with regard to thedetermination of TS packets to be multiplexed, TS packets to bemultiplexed are determined, by assuming the first virtual decoderconfigured to decode the audio data encoded with the first encodingmethod, and the second virtual decoder configured to decode the audiodata encoded with the second encoding method based on the timing valueadded to the audio data encoded with the second encoding method, basedon multiplexing constraints arranged to randomly access TS packets to bemultiplexed.

With a recording medium according to the present invention, a pluralityof TS packets obtained by packetizing audio data encoded with a firstencoding method serving as a predetermined encoding method to aplurality of PES packets, which are further packetized to a plurality ofTS packets, and a plurality of TS packets obtained by packetizing audiodata encoded with a second encoding method, which is a variable-lengthencoding method, and also differs from the first encoding method,arranged to add a timing value representing timing employed for a caseof being decoded to each predetermined audio data unit to a plurality ofPES packets, which are further packetized to a plurality of TS packets,are multiplexed and recorded, a plurality of the PES packets includepoint-in-time information employed for a case of being decoded, and alsoare obtained by the audio data encoded with the first encoding method,and the audio data encoded with the second encoding method beingsubjected to PES packetizing such that the audio data unit satisfying apredetermined cycle appears at the head of a PES payload, and aplurality of the TS packets include the same ID, and also are TS packetsobtained by assuming a first virtual decoder configured to decode theaudio data encoded with the first encoding method, and a second virtualdecoder configured to decode the audio data encoded with the secondencoding method based on the timing value added to the audio dataencoded with the second encoding method, and also determining TS packetsto be multiplexed based on multiplexing constraints arranged to randomlyaccess the multiplexed TS packets.

According to a second aspect of the present invention, a plurality of TSpackets obtained by packetizing audio data encoded with the firstencoding method to a plurality of PES packets, which are furtherpacketized to a plurality of TS packets, and a plurality of TS packetsobtained by packetizing audio data encoded with the second encodingmethod arranged to add a timing value representing timing employed for acase of being decoded to each predetermined audio data unit to aplurality of PES packets, which are further packetized to a plurality ofTS packets, are multiplexed and recorded, a plurality of the PES packetsinclude point-in-time information employed for a case of being decoded,and also are obtained by the audio data encoded with the first encodingmethod, and the audio data encoded with the second encoding method beingsubjected to PES packetizing such that the audio data unit satisfying apredetermined cycle appears at the head of a PES payload, and aplurality of the TS packets include the same ID, and also are TS packetsobtained by assuming a first virtual decoder configured to decode theaudio data encoded with the first encoding method, and a second virtualdecoder configured to decode the audio data encoded with the secondencoding method based on the timing value added to the audio dataencoded with the second encoding method, and also determining TS packetsto be multiplexed based on multiplexing constraints arranged to randomlyaccess the multiplexed TS packets.

According to the present invention, the TS packets of an audio streamcan be multiplexed. In particular, according to the present invention,the TS packets of two audio streams encoded with different encodingmethods can be multiplexed into one transport stream.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram describing the configuration of an existing encodingapparatus.

FIG. 2 is a diagram illustrating an STD model which the encodingapparatus in FIG. 1 assumes.

FIG. 3 is a diagram describing constraints in a case wherein a sendingapparatus to which the present invention is applied encodes an audiostream using an MPEG2-TS method.

FIG. 4 is a diagram illustrating a configuration example of the sendingapparatus in FIG. 3.

FIG. 5 is a diagram describing the data flows of a BS audio ES and an HQaudio ES.

FIG. 6 is a diagram describing a data configuration example of a BSaudio ES and an HQ audio ES.

FIG. 7 is a diagram describing an example wherein a BS audio ES isconverted into a BS audio TS.

FIG. 8 is a diagram describing an example wherein an HQ audio ES isconverted into an HQ audio TS.

FIG. 9 is a diagram describing an example wherein a BS audio TS and anHQ audio TS are multiplexed.

FIG. 10 is a diagram describing a TS to be input to the TS multiplexingunit shown in FIG. 4.

FIG. 11 is a diagram describing data configuration examples of an HQaudio PES packet and an HQ audio TS packet.

FIG. 12 is a diagram for describing the multiplexing constraints of a BSaudio TS packet and an HQ audio TS packet.

FIG. 13 is a diagram for describing the multiplexing constraints of a BSaudio TS packet and an HQ audio TS packet.

FIG. 14 is a diagram illustrating a model example of the virtual decodershown in FIG. 3.

FIG. 15 is a diagram describing a detailed example of the audio datadecoding processing unit shown in FIG. 14.

FIG. 16 is a diagram describing the audio decoder of a variable bit rateshown in FIG. 15.

FIG. 17 is a flowchart describing TS packet sending processing.

FIG. 18 is a flowchart describing TS packet sending processing.

FIG. 19 is a flowchart describing PES packetizing processing.

FIG. 20 is a flowchart describing calculation processing of the amountof occupied buffer as to BS audio.

FIG. 21 is a flowchart describing calculation processing of the amountof occupied buffer as to HQ audio.

FIG. 22 is a flowchart describing multiplexing constraint processing forrandom access.

FIG. 23 is a block diagram illustrating a configuration example of arecording apparatus configured to create an EP_map.

FIG. 24 is a diagram illustrating an application format example on anoptical disc.

FIG. 25 is a diagram describing a relation between an EP_map and a ClipAV stream.

FIG. 26 is a diagram describing the configuration of an audio EP_map.

FIG. 27 is a diagram describing an EP_map in a case wherein a TS isconfigured of a BS audio ES and an HQ audio TS.

FIG. 28 is a flowchart describing the recording processing of a clipinformation file.

FIG. 29 is a flowchart describing processing for creating an EP_map asto a BS audio ES and an HQ audio ES.

FIG. 30 is a block diagram illustrating a configuration example of aplayback apparatus.

FIG. 31 is a block diagram illustrating a configuration example of theAV decoder shown in FIG. 30.

FIG. 32 is a block diagram illustrating another configuration example ofthe AV decoder shown in FIG. 30.

FIG. 33 is a flowchart describing random access playback processing asto a BS audio ES.

FIG. 34 is a flowchart describing random access playback processing asto an HQ audio ES.

FIG. 35 is a diagram illustrating a configuration example of a personalcomputer.

Reference Numerals 111 sending apparatus 112 virtual receiving apparatus121 virtual decoder 131 input unit 132 audio encoder 133 buffer 134extraction information adding unit 135 control unit 136 PES-packetizingunit 137 TS-packetizing unit 138 multiplexing unit 139 sending unit 141first encoder 142 second encoder 143 first buffer 144 second buffer 171BS audio ES 172 BS audio PES 173 BS audio TS 181 HQ audio ES 182 HQaudio PES 183 HQ audio TS 190 transport stream 231-1 through 231-j BSaudio TS packet 232-1 through 232-k HQ audio TS packet 261 PTS_DTS_flags263 PTS 275 Input timing information 276 detailed information 341 PIDfilter 361-1, 361-2 transport priority filter 362-1, 362-2 transportbuffer 363-1, 363-2 elementary buffer 364-1 audio decoder 364-2 audiodecoder of a variable bit rate 391 FIFO buffer

392 audio decoder 501 recording apparatus 521 controller 522 operationinput unit 526 recording control unit

BEST MODE FOR CARRYING OUT THE INVENTION

Description will be made below regarding an embodiment of the presentinvention with reference to the drawings.

FIG. 3 is a diagram describing constraints in a case wherein a sendingapparatus 111 to which the present invention is applied sends an audiostream using the MPEG (Moving Picture Experts Group) 2-TS (TransportStream) (hereafter, referred to as MPEG2-TS) method.

The sending apparatus 111 is an apparatus wherein following a streambeing subjected to PES packetizing using the MPEG2-TS method forexample, the PES packets are packetized to TS packets, the TS packetsare multiplexed to generate an MPEG2-TS (MPEG2 transport stream), andthe MPEG2-TS is sent. For example, the sending apparatus 111 records thegenerated MPEG2-TS in a removable medium 113 via a drive 112, orcontrols a communication unit 114 to send the MPEG2-TS to a network 115.At this time, in the event of packetizing a video stream or audio streamto TS packets using the MPEG2-TS method, the sending apparatus 111generates an MPEG2-TS by assuming a virtual decoder 121 provided in avirtual receiving apparatus 120 so as to perform decoding processingcorrectly at this virtual decoder. The virtual receiving apparatus 120,which is connected to a drive 122, is assumed to read out an MPEG2-TSrecorded in the removable medium 113 via the drive 122, or controls acommunication unit 123 to obtain an MPEG2-TS from the network 115. Notethat the removable medium 113 is configured of a magnetic disk, opticaldisc, magneto-optic disc, or semiconductor memory, or the like. Also, aconfiguration example of the virtual decoder 121 will be described laterwith reference to FIG. 14 and FIG. 15.

FIG. 4 is a block diagram illustrating a configuration example of thesending apparatus 111 shown in FIG. 3. In FIG. 4, description will bemade regarding an arrangement wherein the sending apparatus 111 encodesan audio stream, packetizes this to TS packets (as MPEG2-TS packets),and sends the MPEG2-TS packets.

The sending apparatus 111 is provided with an input unit 131, an audioencoder 132, a buffer 133, an extraction information adding unit 134, acontrol unit 135, a PES (Packetized Elementary Stream) packetizing unit136, a TS-packetizing unit 137, a multiplexing unit 138, and a sendingunit 139. Also, the audio encoder 132 is provided with a first encoder141, and a second encoder 142. Further, the buffer 133 is provided witha first buffer 143, and a second buffer 144.

Audio data to be sent is input to the input unit 131. The input unit 131supplies input audio data to the first encoder 141 and the secondencoder 142 of the audio encoder 132.

The first encoder 141 is an encoder configured to encode audio data withan audio encoding method decodable with a general-purpose audio decoder(e.g., fixed-length encoding method). The second encoder 142 is anencoder configured to encode audio data with an audio encoding methoddecodable with a high-performance audio decoder alone (e.g.,variable-length encoding method). Specifically, the second encoder 142is an audio of a variable bit rate (VBR), and performs encoding using anaudio encoding method which employs a FIFO (First-In First-Out) bufferconfigured to suppress the peak rate of a VBR low at the time ofdecoding. Also, the second encoder 142 adds a timing value indicatingtime represented with a sampling cycle of audio information wherein anaudio access unit is transferred to the FIFO buffer (a later-describedFIFO buffer 391 shown in FIG. 10) of the virtual decoder at the time ofencoding. Note that a timing value indicating time represented with asampling cycle of audio information wherein an audio access unit istransferred to the FIFO buffer of the virtual decoder, which is addedwhen the second encoder 142 performs encoding, will be also referred toas input timing below. Note that the first encoder 141 adds no inputtiming at the time of encoding.

Now, the second encoder 142 performs encoding using a high-performanceencoding method as compared with the first encoder 141, so audioplayback quality increases, functionality increases in the case ofdecoding and playing an audio stream which is a result of encoding withthe second encoder 142 as compared with the case of decoding and playingan audio stream which is a result of encoding with the first encoder141.

Note that, hereinafter, an encoding method employed by the first encoder141 will be referred to as a first encoding method, and an encodingmethod employed by the second encoder 142 will be referred to as asecond encoding method. The second encoding method is a variable bitrate (VBR) audio, and is an audio encoding method employing a FIFO(First-In First-Out) buffer configured to suppress the peak rate of aVBR low at the time of decoding. That is to say, the second encodingmethod is a variable-length encoding method, and in the event ofdecoding an audio ES encoded with this method, an FIFO buffer isnecessary at the decoding side. Now, let us say that the output bit rateof an audio stream to be encoded with a variable-length encoding methodand to be output is a variable length. Conversely, let us say that theoutput bit rate of an audio stream to be encoded with a fixed-lengthencoding method and to be output is a fixed length. Hereinafter, astream which is a result of the first encoder 141 encoding audio datausing the first encoding method will be referred to as a BS audio ES(basic audio elementary stream), and a stream which is a result of thesecond encoder 142 encoding audio data using the second encoding methodwill be referred to as an HQ audio ES (high quality audio elementarystream).

The first encoder 141 encodes audio data supplied from the input unit131 using the first encoding method, and supplies a BS audio ES obtainedas a result thereof to the first buffer 143 of the buffer 133. Thesecond encoder 142 encodes audio data supplied from the input unit 131using the second encoding method, and supplies an HQ audio ES obtainedas a result thereof to the second buffer 144 of the buffer 133. Thus,the first buffer 143 stores (buffers) a BS audio ES, and the secondbuffer 144 stores (buffers) an HQ audio ES. Subsequently, each of thefirst buffer 143 and the second buffer 144 reads out an audio streamstored in itself at a predetermined timing based on the control from thecontrol unit 135, and supplies this to the PES-packetizing unit 136.

The control unit 135 monitors a BS audio ES stored in the first buffer143 and an HQ audio ES stored in the second buffer 144, or controls eachunit of the PES-packetizing unit 136, TS-packetizing unit 137,multiplexing unit 138, and sending unit 139. Also, the control unit 135manages a PTS (Presentation Time Stamp) serving as point-in-timeinformation employed in a case of being decoded, or supplies a PID(Packet Identification) to be added to a TS packet for identifying thetype of stream to the TS-packetizing unit 137. Further, assuming alater-described virtual decoder 121 shown in FIG. 14 and FIG. 15 as avirtual decoder, the control unit 135 performs the calculation of theamount of occupied buffer of the virtual decoder 121, and alsodetermines TS packets to be multiplexed from the multiple TS packetspacketized by the TS-packetizing unit 137 based on multiplexingconstraints for random access. In other words, the control unit 135determines (controls) TS packets which the multiplexing unit 138multiplexes based on the calculation of the amount of occupied buffer ofthe virtual decoder 121, and multiplexing constraints for random access.

The PES-packetizing unit 136 extracts a BS audio ES stored in the firstbuffer 143, and an HQ audio ES stored in the second buffer 144 at thetiming based on the control from the control unit 135, and packetizesthese based on the control from the control unit 135. At this time, thePES-packetizing unit 136 stores the PTS supplied from the control unit135 in each PES packet of a PES. That is to say, a PTS is stored in eachPES packet (a PES packet corresponding to a BS audio ES and a PES packetcorresponding to an HQ audio ES) output from the PES-packetizing unit136.

With the present embodiment, let us say that each of the multiple PESpackets (BS audio PES packets) generated based on a BS audio ES issupplied to the TS-packetizing unit 137 from the TS-packetizing unit 136continuously in a predetermined order. In this case, consequently, onestream made up of the multiple BS audio PES packets (hereafter, this onestream will be referred to as a BS audio PES) is supplied toTS-packetizing unit 137 from the PES-packetizing unit 136. Also, let ussay that each of the multiple PES packets generated based on an HQ audioES (HQ audio PES packets) is supplied to the TS-packetizing unit 137from the TS-packetizing unit 136 continuously in a predetermined order.In this case, consequently, one stream made up of the multiple HQ audioPES packets (hereafter, this one stream will be referred to as an HQaudio PES) is supplied to TS-packetizing unit 137 from thePES-packetizing unit 136.

The extraction information adding unit 134 supplies an ID(Identification) having a unique value added uniquely to each type of aBS audio stream and an HQ audio stream to the TS-packetizing unit 137 soas to allow the decoding side (virtual receiving apparatus 120 sideshown in FIG. 3) to extract a BS audio stream and an HQ audio stream(i.e., streams encoded with different encoding methods). That is to say,the extraction information adding unit 134 supplies identificationinformation (ID) for identifying each of a BS audio stream and an HQaudio stream to the TS-packetizing unit 137.

As for this ID, for example, a Transport_priority flag included in atransport packet header can be employed. The extraction informationadding unit 134 supplies to the TS-packetizing unit 137 information(extraction information) such as setting Transport_priority=1 to atransport packet for sending a BS audio stream, and settingTransport_priority=0 to a transport packet for sending an HQ audiostream.

The TS-packetizing unit 137 packetizes the PES packet stream suppliedfrom the PES-packetizing unit 136 to TS packets (transport streampackets) based on the control of the control unit 135. Specifically, theTS-packetizing unit 137 packetizes the BS audio PES supplied from thePES-packetizing unit 136 to TS packets, and also packetizes the HQ audioPES supplied from the PES-packetizing unit 136 to TS packets. At thistime, not only an ID (e.g., Transport_priority flag) supplied from theextraction information 134, but also a PID from the control unit 135 aresupplied to the TS-packetizing unit 136. With the present embodiment,let us say that a PID included in a BS audio stream and a PID includedin an HQ audio stream are the same ID. That is to say, in the event thataudio TS packets encoded with the two different encoding methods aremultiplexed into one audio stream, a PID is added such that this oneaudio stream has the same ID as a whole. The TS-packetizing unit 137generates TS packets so as to include the extraction information (e.g.,Transport_priority flag) supplied from the extraction information addingunit 134, and the PID supplied from the control unit 135 (in the headersof the TS packets). Note that, hereafter, the results of a BS audio PESbeing packetized to TS packets are referred to as BS audio TS packets,and the results of an HQ audio PES being packetized to TS packets arereferred to as HQ audio TS packets. Also, with BS audio TS packets andHQ audio TS packets, extraction information (e.g., Transport_priorityflag) added to each TS packet differs, but with the same PID.

The multiplexing unit 138 multiplexes the TS packets supplied from theTS-packetizing unit 137 based on the control of the control unit 135.Specifically, the multiplexing unit 138 multiplexes the BS audio TSpackets and the HQ audio TS packets supplied from the TS-packetizingunit 137 based on the control of the control unit 135, and generates anaudio stream (MPEG2-TS) having the same PID as one stream. At this time,description will be made later regarding constraints such as the orderof TS packets to be multiplexed by the PES-packetizing unit 136, andconstraints when the PES-packetizing unit 136 performs PES packetizing.The multiplexing unit 138 sends the multiplexed and generated MPEG2-TSto the sending unit 139 which is the subsequent stage.

The sending unit 139 sends the MPEG2-TS supplied from the multiplexingunit 138. For example, the sending unit 139, as shown in FIG. 3,controls the drive 112 to record the MPEG2-TS in the removable medium113, or controls the communication unit 114 to send the MPEG2-TS to anexternal apparatus via the network 115.

Note that the extraction information adding unit 134 not only suppliesan ID serving as extraction information to the TS-packetizing unit 137,but also may further send extraction information to the PES-packetizingunit 136. For example, the extraction information adding unit 134supplies an ID having a unique value added uniquely to each type of a BSaudio stream and an HQ audio stream to the PES-packetizing unit 146 soas to allow the decoding side (e.g., the virtual receiving apparatus 121side shown in FIG. 3) to extract each type of stream of a BS audiostream and an HQ audio stream.

As for this ID, with the present embodiment, Stream_id orSream_id_extension is employed. Stream_id denotes Stream_id included inStream_id included in a PES packet header conformed to the MPEG2 systemsspecifications. Also, Sream_id_extension denotes Sream_id_extensionincluded in a PES packet header conformed to the MPEG2 systemsspecifications Amendment2 (2003). In the event that an audio stream is astream other than MPEG Audio (MPEG-1/-2 Audio, MPEG ACC),Sream_id_extension is preferably employed. In the event of employingSream_id_extension, the MPEG2 systems specifications Amendment2 (2003)stipulates to set “1111 1101” (value meaning extension_stream_id) toStream_id. Also, the MPEG2 systems specifications Amendment2 (2003)stipulates to enable Sream_id_extension having a unique value foridentifying the type of stream (BS audio stream and HQ audio stream) tobe employed.

In the event of the extraction information adding unit 134 supplying astream ID (e.g., Sream_id_extension) to the PES-packetizing unit 136,the PES-packetizing unit 146 packetizes each of the obtained BS audiostream and HQ audio stream to PES packets so as to include correspondingone stream ID of stream IDs (e.g., Sream_id_extension) supplied from theextraction information adding unit 134 in the PES packets. Each streamID of the PES packets is an ID for identifying the type of correspondingPES packet. Now, the type of PES packet is either of a BS audio streamor an HQ audio stream. For example, the PES packet of the type of a BSaudio stream denotes a PES packet including at least part of data of aBS audio stream (BS audio ES). Accordingly, in order that the virtualreceiving apparatus 120 shown in FIG. 3 serving as the receiving sideselects a PES packet of a desired type of audio stream, it is necessaryto recognize the value of a stream ID added to the PES packet thereof.

Next, a data (stream) flow example in the sending apparatus 111 shown inFIG. 4 will be briefly described with reference to the flowchart shownin FIG. 5.

The input unit 131 supplies input audio data to the first encoder 141 instep S1, and also supplies this to the second encoder 142 in step S11.The first encoder 141 encodes the input audio data in step S2, andsupplies a BS audio ES to the PES-packetizing unit 136 in step S3. ThePES-packetizing unit 136 packetizes the BS audio ES supplied from thefirst encoder 141 to PES packets, and supplies the BS audio PES to theTS-packetizing unit 137. The TS-packetizing unit 137 packetizes the BSaudio PES supplied from the PES-packetizing unit 136 in step S6 to TSpackets, and supplies the BS audio TS to the multiplexing unit 138 instep S7. Also, similarly, the second encoder 142 encodes the audio datainput in step S12, and supplies an HQ audio ES to the PES-packetizingunit 136 in step S13. The PES-packetizing unit 136 packetizes the HQaudio ES supplied from the second encoder 142 in step S14 to PESpackets, and supplies the HQ audio PES to the TS-packetizing unit 137 instep S15. The TS-packetizing unit 137 packetizes the HQ audio PESsupplied from the PES-packetizing unit 136 in step S16 to TS packets,and supplies the HQ audio TS to the multiplexing unit 138 in step S17.The multiplexing unit 138 multiplexes the BS audio TS and HQ audio TSsupplied in the processing in step S7 and step S17 to generate oneMPEG2-TS (transport stream) in step S21, and outputs the generatedMPEG2-TS in step S22 (in the case of FIG. 4, outputs to the sending unit139).

Thus, the BS audio ES encoded and obtained by the first encoder 141, andthe HQ audio ES encoded and obtained by the second encoder 142 are eachindependently packetized to PES packets (step S4 and step S14), and alsopacketized to TS packets (step S6 and step S16), and multiplexed intoone audio stream (transport stream) at the multiplexing unit 138.

A more specific example will be described with reference to FIG. 6. InFIG. 6, the same step numbers are appended with regard to the processingcorresponding to the processing in FIG. 5.

With the example shown in FIG. 6, the first stage illustrates a BS audioES 171 and an HQ audio ES 181, the second stage illustrates a BS audioPES 172 and an HQ audio PES 182, the third stage illustrates a BS audioTS 173 and an HQ audio TS 183, and the fourth stage illustrates a TS(transport stream) 190.

The BS audio ES 171 illustrates a state of being encoded and output bythe first encoder 141 shown in FIG. 4, the BS audio PES 172 illustratesa state of being PES-packetized (step S4) and output by thePES-packetizing unit 136 shown in FIG. 4, and the BS audio TS 173illustrates a state of being TS-packetized (step S6) and output by theTS-packetizing unit 137 shown in FIG. 4. Also, the HQ audio ES 181illustrates a state of being encoded and output by the second encoder142 shown in FIG. 4, the HQ audio PES 182 illustrates a state of beingPES-packetized (step S14) and output by the PES-packetizing unit 136shown in FIG. 4, and the HQ audio TS 183 illustrates a state of beingTS-packetized (step S16) and output by the TS-packetizing unit 137 shownin FIG. 4. The TS 190 illustrates a state of being multiplexed (stepS21) and output by the multiplexing unit 138 shown in FIG. 4.

Both of the BS audio ES 171 and the HQ audio ES 181 are encoded with apredetermined number of audio samples as one unit, and are separated andshown by a suffix shown in a parenthesis for each unit. Specifically,for example, the BS audio ES 171 is encoded by being separated intomultiple units (audio access units) such as BS(1), BS(2), and so onthrough BS(n) (n is an arbitrary integer). Similarly, for example, theHQ audio ES 181 is encoded by being separated into multiple units (audioaccess units) such as HQ(1), HQ(2), and so on through HQ(m). An audioaccess unit is an encoding unit making up an audio ES, and is also adecoding unit. For example, let us say that in the event of playing oneaudio access unit of a BS audio ES, the playback time thereof is 32milliseconds, and in the event of playing one audio access unit of an HQaudio ES, the playback time thereof is 1/1200 second.

The PES-packetizing unit 136 shown in FIG. 4 packetizes the BS audio ES171 and the HQ audio ES 181 to PES packets having a different stream ID.For example, the PES-packetizing unit 136 sets the stream ID of each PESpacket corresponding to the BS audio ES 171 to “Stream_id_extension=b1”,and adds this to the PES header of a PES packet to be generated. Also,for example, the PES-packetizing unit 136 sets the stream ID of each PESpacket corresponding to the HQ audio ES 181 to “Stream_id_extension=b2”,and adds this to the PES header of a PES packet to be generated. In FIG.4, the BS audio PES 172 is configured of PES packets 172-1 through172-n′ made up of a PES header and a PES payload (BS(1), BS(2), and soon through BS(n′) in the drawing). In other words, the BS audio PES 172is configured of n′ (n′ is an arbitrary integer) PES packets 172-1through 172-n′. Also, the HQ audio PES 182 is configured of BS audio PESpackets 182-1 through 182-m′ made up of a PES header and a PES payload(HQ(1), HQ(2), and so on through BS(m′) in the drawing). In other words,the HQ audio PES 182 is configured of m′ (m′ is an arbitrary integer) HQaudio PES packets 182-1 through 182-m′.

As for constraints in the case of PES packetizing, there is a constraintwherein PES packetizing needs to be performed such that there should bePES packets within one second wherein a PTS value stored in a PES headerof the BS audio PES 172 is identical to a PTS value stored in a PESheader of the HQ audio PES 182. Here, with between the BS audio PESpacket 172-1 (PES packet made up of a PES header and a PES payload(described as BS(1)) in the drawing) and the HQ audio PES packet 182-1(PES packet made up of a PES header and a PES payload (described asHQ(1)) in the drawing), the PTS values included in the mutual PESheaders are equal. PES packetizing is performed such that such PESpackets having the same PTS should exist within one second in the caseof converting (calculating) the PTS into time. That is to say, PESpacketizing is performed such that an HQ audio PES packets having thesame PTS as the PTS of a BS audio PES packet exists within one second.Note that with the sending apparatus 111 shown in FIG. 4, thePES-packetizing unit 136 is configured to perform PES packetizing basedon this constraint.

For example, the PES-packetizing unit 136, as shown in the first stageand the second stage in FIG. 7, adds a PTS to each PES header ofmultiple BS audio PES packets making up the BS audio PES 172 (e.g.,PTS=BS1 to the BS audio PES packet 172-1), and also stores one or moreaccess units included in the BS audio ES 171 to each PES payload. Also,for example, the PES-packetizing unit 136, as shown in the first stageand the second stage in FIG. 8, adds a PTS to each PES header ofmultiple HQ audio PES packets making up the HQ audio PES 182 (e.g.,PTS=HQ1 to the HQ audio PES packet 182-1), and also stores one or moreaccess units included in the HQ audio ES 181 to each PES payload. Thus,the PES-packetizing unit 136 generates the BS audio PES 172 and the HQaudio PES 182 shown in FIG. 6, and supplies these to the TS-packetizingunit 137.

On the other hand, the TS-packetizing unit 137 packetizes each PESpacket making up the BS audio PES 172 to TS packets, and also packetizeseach PES packet making up the HQ audio PES 182 to TS packets. At thistime, the TS-packetizing unit 137 adds a transport_priority flag foridentifying the BS audio PES 172 and the HQ audio PES 182, and a PID foridentifying an audio stream to the header (TS header) of a TS packet tobe generated. That is to say, let us say that the PID stored in each TSheader of the multiple TS packets 231-1 through 231-j (j is an arbitraryinteger) making up the generated BS audio TS 173, and the PID stored ineach TS header of the multiple TS packets 232-1 through 232-k (k is anarbitrary integer) making up the generated HQ audio TS 183 are the samePID, but the transport_priority flag stored in each TS header of themultiple TS packets 231-1 through 231-j making up the generated BS audioTS 173, and the transport_priority flag stored in each TS header of themultiple TS packets 232-1 through 232-k making up the generated HQ audioTS 183 differ.

Specifically, the TS-packetizing unit 137, as shown in the second stageand the third stage in FIG. 7, adds “PID=a0, tp (transport_priority)=1”to each TS header of the multiple BS audio TS packets making up the BSaudio TS 173, and as shown in the second stage and the third stage inFIG. 8, adds “PID=a0, tp (transport_priority)=0” to each header of themultiple HQ audio TS packets making up the HQ audio TS 183.

Thus, the same PID is added to one audio stream (TS190), and a differenttp (transport_priority) is added thereto to identify a BS audio ES andan HQ audio ES included in one stream.

The multiplexing unit 138 multiplexes the BS audio TS 173 and the HQaudio TS 183 based on the control from the control unit 135 to generateone transport stream (MPEG2-TS) 190. With the example shown in FIG. 6,the TS (MPEG2-TS) 190 is configured so as to include a TS packet 221corresponding to a PAT (Program Association Table), a TS packet 222corresponding to a PMT (Program Map Table), BS audio TS 231-1 through231-j (j is an arbitrary integer), and HQ audio TS 232-1 through 232-k(k is an arbitrary integer).

As for constraints in the case of multiplexing this, there are thefollowing two constraints.

The first constraint is a constraint wherein following completion ofmultiplexing of TS packets equivalent to one PES packet, multiplexing ofTS packets equivalent to the next one PES packet needs to be performed.That is to say, with both of a BS audio ES and an HQ audio ES, TSpackets equivalent to one PES packet needs to be multiplexedcontinuously, and also TS packets including different types of PESpackets does not need to be mixed. As for a specific example, in theevent that the BS audio PES packet 172-1 is stored in the TS payloads ofthe BS audio TS packets 231-1 through 231-3, and the HQ audio PES packet182-1 is stored in the TS payloads of the HQ audio TS packets 232-1through 232-3, the BS audio TS packets 231-1 through 231-3 need to bemultiplexed continuously, and also the HQ audio TS packets 232-1 through232-3 need to be multiplexed continuously. Based on this constraint, forexample, following the BS audio TS packets 231-1 through 231-3, the HQaudio TS packets 232-1 through 232-3 are multiplexed continuously.According to this constraint, for example, with a playback apparatuscapable of playback of other types of audio stream, audio can be managedsmoothly.

The second constraint is a constraint (multiplexing constraint forrandom access) wherein with a relation between a BS audio TS packet andan HQ audio TS packet both having the same PTS value, multiplexingshould be performed such that the HQ audio TS packet is certainlydisposed after the BS audio TS packet. For example, in the event thatthe PTS value stored in the BS audio TS packet 231-1 and the PTS valuestored in the HQ audio TS packet 232-1 have the same PTS value, it isnecessary to perform multiplexing such that the HQ audio TS packet 232-1is disposed after the BS audio TS packet 231-1 (not necessarilyimmediately after thereof, as long as after thereof). That is to say,there is provided a constraint wherein with regard to TS packets inwhich a PES packet and a PES payload having the same PTS value arestored, the TS packet of an HQ audio ES is disposed after the TS packetof a BS audio ES. This second constraint is a constraint based on arestriction wherein the entry point of an EP_map employed for performingrandom access needs to be an interval of one second or less. The detailsof an EP_map will be described later with reference to FIG. 23 throughFIG. 29.

As for this cycle, for example, in the event that the playback timeequivalent to the five audio access units of the BS audio ES 171 isequal to the playback time equivalent to the 192 audio access units ofthe HQ audio ES 181, consequently access units having the same PTS existat a cycle equivalent to the five audio access units of the BS audio ES171 (i.e., equivalent to the 192 audio access units of the HQ audio ES181).

Next, brief description will be made regarding change in a dataconfiguration in the case of the BS audio ES 171 shown in FIG. 6 beingPES-packetized to a BS audio PES 172, and the BS audio PES 172 beingfurther TS-packetized to a BS audio TS 173 with reference to FIG. 7.Note that in the drawing, the portions corresponding to the portionsshown in FIG. 6 are appended with the same reference numerals and thesame step numbers.

As shown in FIG. 7, in the event of the BS audio ES 171 being subjectedto PES packetizing (step S4), the multiple audio access units (BS(1),BS(2), and so on through BS(n)) included in the BS audio ES 171 arestored in the PES payloads of the BS audio PES packets 172-1 through172-n′ making up the BS audio PES 172. In the case of the example shownin FIG. 7, the three audio access units of the BS(1) through BS(3) ofthe BS audio ES 171 are stored in the PES payload of the BS audio PESpacket 172-1, and the value of PTS=BS1 is stored in the PES header ofthe BS audio PES packet 172-1. Also, for example, the three audio accessunits of the BS(4) through BS(6) of the BS audio ES 171 are stored inthe PES payload of the BS audio PES packet 172-2, and the value ofPTS=BS2 is stored in the PES header of the BS audio PES packet 172-2.Also, for example, the two audio access units of the BS(n−1) and BS(n)of the BS audio ES 171 are stored in the PES payload of the BS audio PESpacket 172-n′, and the value of PTS=BSn′ is stored in the PES header ofthe BS audio PES packet 172-n′.

Subsequently, in the event of the BS audio PES 172 being subjected to TSpacketizing (step S6), the data of the BS audio PES 172 is each storedin the TS payloads of BS audio TS packets 231-1 through 231-j making upthe BS audio TS 173. For example, the BS audio PES packet 172-1 isstored in the TS payloads of the BS audio TS packets 231-1 and 231-2,and the BS audio PES packet 172-2 is stored in the TS payloads of the BSaudio TS packets 231-3 and 232-4. At this time, the PTS of the PESheader of the BS audio PES packet 172-1, i.e., PTS=BS1 is stored in theTS payload of the BS audio TS packet 231-1, the PTS of the PES header ofthe BS audio PES packet 172-2, i.e., PTS=BS2 is stored in the TS payloadof the BS audio TS packet 231-3, and the PTS of the PES header of the BSaudio PES packet 172-n′, i.e., PTS=BSn′ is stored in the TS payload ofthe BS audio TS packet 231-j-1.

Thus, among the BS audio TS packets, there is a TS packet of which theTS payload stores a PTS value.

Next, brief description will be made regarding change in a dataconfiguration in the case of the HQ audio ES 181 shown in FIG. 6 beingPES-packetized to an HQ audio PES 182, and the HQ audio PES 182 beingfurther TS-packetized to an HQ audio TS 183 with reference to FIG. 8.Note that in the drawing, the portions corresponding to the portionsshown in FIG. 6 are appended with the same reference numerals and thesame step numbers. Also, the HQ audio ES shown in FIG. 8 is basicallythe same as the case of the BS audio ES shown in FIG. 7.

As shown in FIG. 8, in the event of the HQ audio ES 181 being subjectedto PES packetizing (step S14), the multiple audio access units (HQ(1),HQ(2), and so on through HQ(m)) included in the HQ audio ES 181 arestored in the PES payloads of the HQ audio PES packets 182-1 through182-m′ making up the HQ audio PES 182. In the case of the example shownin FIG. 8, the three audio access units of the HQ(1) through HQ(3) ofthe HQ audio ES 181 are stored in the PES payload of the HQ audio PESpacket 182-1, and the value of PTS=HQ1 is stored in the PES header ofthe HQ audio PES packet 182-1. Also, for example, the three audio accessunits of the HQ(4) through HQ(6) of the HQ audio ES 181 are stored inthe PES payload of the HQ audio PES packet 182-2, and the value ofPTS=HQ2 is stored in the PES header of the HQ audio PES packet 182-2.Also, for example, the two audio access units of the HQ(m−1) and HQ(m)of the HQ audio ES 181 are stored in the PES payload of the HQ audio PESpacket 182-m′, and the value of PTS=HQm′ is stored in the PES header ofthe HQ audio PES packet 182-m′.

Subsequently, in the event of the HQ audio PES 182 being subjected to TSpacketizing (step S16), the data of the HQ audio PES 182 is each storedin the TS payloads of HQ audio TS packets 232-1 through 232-k making upthe HQ audio TS 183. For example, the HQ audio PES packet 182-1 isstored in the TS payloads of the HQ audio TS packets 232-1 through232-3, and the HQ audio PES packet 182-2 is stored in the TS payloads ofthe HQ audio TS packets 232-4 and 232-6. At this time, the PTS of thePES header of the HQ audio PES packet 182-1, i.e., PTS=HQ1 is stored inthe TS payload of the HQ audio TS packet 232-1, the PTS of the PESheader of the HQ audio PES packet 182-2, i.e., PTS=HQ2 is stored in theTS payload of the HQ audio TS packet 232-4, and the PTS of the PESheader of the HQ audio PES packet 182-m′, i.e., PTS=HQm′ is stored inthe TS payload of the HQ audio TS packet 232-k-2.

Thus, among the HQ audio TS packets, there is a TS packet of which theTS payload stores a PTS value.

Subsequently, in the event of multiplexing the BS audio TS 173 shown inFIG. 7 and the HQ audio TS 183 shown in FIG. 8, multiplexing isperformed based on a constraint wherein following completion ofmultiplexing of TS packets equivalent to one PES packet, multiplexing ofTS packets equivalent to the next one PES packet needs to be performed,and a constraint wherein with a relation between a BS audio TS packetand an HQ audio TS packet having the same PTS value, multiplexing needsto be performed such that the HQ audio TS packet is disposed after theBS audio TS packet.

A specific example of multiplexing based on the constraints will bedescribed with reference to FIG. 9. In FIG. 9, the first stageillustrates the BS audio TS 173 and the HQ audio TS 183, and the secondstage illustrates the TS 190 in the case of multiplexing the BS audio TS173 and the HQ audio TS 183.

For example, in the event that the PTS value (=BS1) stored in the BSaudio TS packet 231-1, and the PTS value (=HQ1) stored in the HQ audioTS packet 232-1 are equal, as shown in the second stage in FIG. 9,multiplexing is performed such that the HQ audio TS packet 232-1 isdisposed after the BS audio TS packet 231-1 having PTS=BS1 (secondmultiplexing constraint). Also, at this time, part of the data of the BSaudio PES packet 172-1 shown in FIG. 7 is stored in the BS audio TSpacket 231-1, and the data of the BS audio PES packet 172-1 is stored innot only the BS audio TS packet 231-1 but also the BS audio TS packet231-2, so the BS audio TS packet 231-1 and the BS audio TS packet 231-2need to be multiplexed continuously (first multiplexing constraint).Similarly, part of the data of the HQ audio PES packet 182-1 shown inFIG. 8 is stored in the HQ audio TS packet 232-1, and the data of the HQaudio PES packet 182-1 is stored in not only the HQ audio TS packet232-1 but also the HQ audio TS packets 232-2 and 232-3, so the HQ audioTS packet 232-1 through 232-3 need to be multiplexed continuously (firstmultiplexing constraint).

Consequently, as shown in the second stage shown in FIG. 9, the HQ audioTS packets 232-1 through 232-3 are disposed after the BS audio TSpackets 231-1 and 231-2. Note that with the example shown in FIG. 9, anarrangement is made wherein the HQ audio TS packets 232-1 through 232-3are disposed immediately after the BS audio TS packets 231-1 and 231-2,but an arrangement may be made wherein other data is disposed betweenthe BS audio TS packets 231-1 and 231-2, and the HQ audio TS packets232-1 through 232-3.

Note that with description up to FIG. 9, description has been maderegarding a case wherein the sending apparatus 111 shown in FIG. 4 sendsaudio data, but actually, the sending apparatus 111 shown in FIG. 4 alsosends video data and system data (the data of a graphic stream, a textsubtitle stream, or the like). In this case as well, video data isencoded by an unshown video encoder, PES-packetized, and TS-packetized,and then multiplexed at the multiplexing unit 138 along with audio TSpackets. At this time, the PID of a TS packet corresponding to the videodata, and the PID of a TS packet corresponding to the audio data differ(it is needless to say that the PID of the BS audio TS packet and thePID of the HQ audio TS packet are the same) as shown in FIG. 10. In thecase of the example shown in FIG. 10, “PID=V0” is added to the header ofeach TS packet included in a TS 241 serving as video data (video ES) asshown in the first stage, “PID=E0” is added to the header of each TSpacket included in a TS 242 serving as other data (system data) as shownin the fourth stage. Thus, a stream having one or more different PIDs isincluded in one program stream.

That is to say, a stream is input to the multiplexing unit 138 as aseparate stream such as a video TS 241, BS audio TS 173, HQ audio TS283, and other TS 242. Here, a BS audio ES and an HQ audio ES aremutually independent streams having no hierarchical relationship.Therefore, there is no constraint at the time of multiplexing (e.g.,there is no constraint such as multiplexing a BS audio ES and an HQaudio ES as a set). Also, with the present embodiment, audio ESesencoded with different encoding methods are appended with the same PID,thereby generating a transport stream.

Next, the PES packet configuration and TS packet configuration of the HQaudio ES 181 having the same PTS value as the PTS value of the BS audioPES 172 will be described with reference to FIG. 11. Specifically, FIG.11 is a diagram describing the configuration of the PES packet 182-1(FIG. 8) of the HQ audio ES 181, and the configuration of the TS packet232-1 in the case of PTS=BS1=HQ1 in FIG. 6 through FIG. 9.

The HQ audio PES packet 182-1, as described with reference to FIG. 6 andFIG. 8, is configured of a PES header and a PES payload. A PES headerincludes a PTS_DTS_flags 261, other data 262, a PTS 263, and other data264.

The PTS_DTS_flags 261 is information indicating the presence/absence ofa PTS and a DTS (Decoding Time Stamp). The PTS_DTS_flags having a valueof “00(b)” indicates that neither a PTS field nor a DTS field isincluded in the PES header, the PTS_DTS_flags having a value of “10(b)”indicates that a PTS field alone is included in the PES header, and thePTS_DTS_flags having a value of “11(b)” indicates that PTS and DTSfields are included in the PES header. In the case of the example shownin FIG. 11, the value of the PTS_DTS_flags 261 is set asPTS_DTS_flags=10(b), which indicates that only the value of the PTS 263is included in the PES header, and no DTS value is included therein, anda PTS value is described in the field of the PTS 263. In the case of theexample shown in FIG. 11, PTS=HQ1 which is the same PTS value as the PTS(=BS1) stored in the corresponding BS audio PES packet 172-1 is storedin the field of the PTS 263.

In the case of the example shown in FIG. 11, four audio access units(AU) 271 through 274 are included in the PES payload of the HQ audio PESpacket 182-1. The audio access units 271 through 274 are high qualityaudios. The audio access unit 271 includes Input timing information 275and detailed information 276. The Input timing information 275 is atiming value indicating time represented with a sampling cycle of audioinformation wherein an audio access unit is transferred to the FIFObuffer of the virtual decoder, which is applied when the second encoder142 encodes. The detailed information 276 is decoding information whichenables decoding at the position thereof. to be started. In other words,the detailed information 276 is information to start decoding from thatposition. This information (detailed information), by which decoding canbe started, includes, for example, a sampling frequency, channelinformation, and so forth. Also, the detailed information 276 isincluded in not all of the access units.

Thus, the headmost audio access unit (of the PES payload) of the HQaudio PES packet having the same PTS as the PTS of the BS audio PESincludes the Input timing information 275 and the detailed information276.

Note that the detailed information 276 is not always included in the HQaudio PES packet. Specifically, the detailed information 276 is includedin the HQ audio PES packet having the same PTS as the PTS of the BSaudio PES, but is not included in the HQ audio PES packet having no samePTS as the PTS of the BS audio PES in some cases.

Each of the TS packets 232-1 through 232-3 which are results of the HQaudio PES packet 182-1 being subjected to TS packetizing includes a TSheader and a TS payload, such as described with reference to FIG. 6 andFIG. 8. A PID and a tp mentioned above with reference to FIG. 10 areadded to a TS header, though not shown in FIG. 11.

Thus, a timing value (Input timing) to be added when the second encoder142 performs encoding is stored as the Input timing information 275 inthe PES payload in which the headmost data of the audio access unit 271is stored. Let us say that, for example, the data length of the PTS 263is 33 bits, the data length of the DTS is 33 bits, and the data lengthof the Input timing is 16 bits.

Now, description will be made with reference to FIG. 12 regarding twoexamples satisfying the constraints in the case of multiplexing the BSaudio TS 173 and the HQ audio TS 183 shown in FIG. 6 (in the case ofobtaining a TS 190).

As described above, the constraints in the case of multiplexing the BSaudio TS 173 and the HQ audio TS 183 into a TS 190 are a constraintwherein following completion of multiplexing of TS packets equivalentinto one PES packet, multiplexing of TS packets equivalent into the nextone PES packet needs to be performed (first constraint), and aconstraint wherein with a relation between the BS audio TS packet andthe HQ audio TS packet both having the same PTS value, multiplexingneeds to be performed such that the HQ audio TS packet is disposed afterthe BS audio TS packet (second constraint).

A first example of a packet layout will be described with reference tothe upper side of FIG. 12. Note here that the BS audio TS packet 281-1and the BS audio TS packet 281-2 correspond to any one of the BS audioTS packets 231-1 through 231-j, and the HQ audio TS packet 282-1 and theHQ audio TS packet 282-2 correspond to any one of the BS audio TSpackets 232-1 through 232-k shown in FIG. 6.

At the upper side of FIG. 12, in the event that the PTS values of the BSaudio TS packet 281-1 and the HQ audio TS packet 282-1 are both PTS#1,the HQ audio TS packet 282-1 is disposed after the BS audio TS packet281-1. That is to say, with regard to TS packets having the same PTSvalue (both PTS#1), the BS audio TS packet 281-1 is disposed before theHQ audio TS packet 282-1. Similarly, in the event that the PTS values ofthe BS audio TS packet 281-2 and the HQ audio TS packet 282-2 are bothPTS#2, the HQ audio TS packet 282-2 is disposed after the BS audio TSpacket 281-2. That is to say, with regard to TS packets having the samePTS value (both PTS#2), the BS audio TS packet 281-2 is disposed beforethe HQ audio TS packet 282-2.

At this time, according to the above-mentioned constraint at the time ofPES packetizing, PES packets having the same PTS are PES-packetized soas to exist within one second in the case of converting (calculating)the PTS into time, so in the event of converting from the PTS#1 to PTS#2into time, the time thereof is set to within one second. That is to say,as shown in FIG. 13, ((PTS#2)-(PTS#1)) is set to within one second.

Here, a cycle of which the one cycle interval is equal to or shorterthan one second, which is a cycle wherein the display point-in-time of aBS audio ES access unit and the display point-in-time of an HQ audio ESaccess unit are equal (e.g., cycle of “PTS#2-PTS#1” shown in FIG. 13),is hereafter referred to as a cycle N. This cycle N may be changedwithin a stream.

A second example of a packet layout will be described with reference tothe lower side of FIG. 12. At the lower side of FIG. 12, in the eventthat the PTS values of the BS audio TS packet 281-1 and the HQ audio TSpacket 282-1 are both PTS#1, the HQ audio TS packet 282-1 is disposedafter the BS audio TS packet 281-1. That is to say, with regard to TSpackets having the same PTS value (both PTS#1), the BS audio TS packet281-1 is disposed before the HQ audio TS packet 282-1. Similarly, in theevent that the PTS values of the BS audio TS packet 281-2 and the HQaudio TS packet 282-2 are both PTS#2, the HQ audio TS packet 282-2 isdisposed after the BS audio TS packet 281-2. That is to say, with regardto TS packets having the same PTS value (both PTS#2), the BS audio TSpacket 281-2 is disposed before the HQ audio TS packet 282-2.

With the TS at the lower side of FIG. 12, the HQ audio TS packet 282-1is disposed after the BS audio TS packet 281-2, which is different fromthe upper side. That is to say, the BS audio TS packet 281-2 of whichthe PTS value is PTS#2 is disposed before the HQ audio TS packet 282-1of which the PTS value is PTS#1. However, according to the constraints,with TS packets having the same PTS value, the HQ audio TS packet needsto be disposed after the BS audio TS packet. That is to say, other datamay be included between the BS audio TS packet and the HQ audio TSpacket having the same PTS value, so consequently, with the TS at thelower side of FIG. 12 as well, this constraint is protected.

Thus, the HQ audio TS packet having the same PTS value as the PTS valueof the BS audio TS packet needs to be disposed after the BS audio TSpacket, as shown at the lower side of FIG. 12, even in the event thatthe HQ audio TS packet 282-1 having the PTS#1 is disposed after the BSaudio TS packet 281-2 having the PTS#2, as long as multiplexing of TSpackets equivalent to the next one PES packet is performed followingcompletion of multiplexing of TS packets equivalent to one PES packet,the constraint is consequently satisfied.

Note that at the lower side of FIG. 12 as well, PES packets having thesame PTS have been PES-packetized so as to always exist within onesecond in the case of the PTS being converted (calculated) into time, soin the event of converting from the PTS#1 to PTS#2 into time, the timethereof is set to within one second.

With the present embodiment, in the event that the sending apparatus 111packetizes the BS audio ES 171 and the HQ audio ES 181 to TS packets,and multiplexes the multiple BS audio TS packets making up the BS audioTS 173, and the multiple HQ audio TS packets making up the HQ audio TS183, which are obtained as a result thereof, into one transport stream190 (MPEG2-TS), TS packets to be multiplexed are determined inaccordance with the performance of the virtual receiving apparatus 120(FIG. 3), and the multiplexing constraints for random access. That is tosay, even in the event that the virtual receiving apparatus 120 is avirtual receiving apparatus capable of handling both of a BS audio ESand an HQ audio ES (capable of decoding both of a BS audio ES and an HQaudio ES), or even in the event that the virtual receiving apparatus 120is a virtual receiving apparatus capable of handling only a BS audio ES(capable of decoding a BS audio ES alone), the timing of multiplexing TSpackets can be regulated (TS packets to be multiplexed can be determinedsequentially) at the sending apparatus 111 side such that decoding canbe performed while causing the buffer provided in the virtual receivingapparatus 120 to neither overflow nor underflow, and also themultiplexing constraints for random access can be protected.

Specifically, the sending apparatus 111 regulates TS packets to bemultiplexed so as to handle a virtual receiving apparatus (hereafter,referred to as a first virtual receiving apparatus) capable of decodingthe BS audio TS 173 shown in FIG. 6, and a receiving apparatus(hereafter, referred to as a second virtual receiving apparatus) capableof decoding the HQ audio TS 183 shown in FIG. 6 to generate thetransport stream 190 shown in FIG. 6. That is to say, the sendingapparatus 111 determines TS packets to be multiplexed so as to cause thedecoder buffer for BS audio ES of a predetermined size to neitheroverflow nor underflow in the event that the virtual receiving apparatus120 extracting and decoding a BS audio ES, and also so as to cause thedecoder buffer for HQ audio ES of a predetermined size to neitheroverflow nor underflow in the event that the virtual receiving apparatus120 extracting and decoding an HQ audio ES, and so as to protect themultiplexing constraints for random access.

That is to say, the two types of virtual receiving apparatus are assumedin the case of the virtual receiving apparatus 120 capable of decodingonly a BS audio ES, and in the case of the virtual receiving apparatus120 capable of decoding an HQ audio ES, and the timing of multiplexingTS packets is regulated so as to be capable of decoding the TS 190multiplexed with each of the two types of virtual receiving apparatus(first virtual receiving apparatus and second virtual receivingapparatus), and also based on the multiplexing constraints for randomaccess.

FIG. 14 is a diagram describing a model of the virtual decoder 121 forencoding constraints in the case of multiplexing a BS audio TS and an HQaudio TS. That is to say, FIG. 14 illustrates a configuration example ofthe virtual decoder 121 (FIG. 3) model included in the virtual receivingapparatus 120 which is assumed in the case of the sending apparatus 111multiplexing a BS audio TS and an HQ audio TS using the MPEG2-TS method.In other words, the virtual decoder 121 shown in FIG. 14 is a model ofthe virtual decoder 121 assumed in the case of the sending apparatus 111multiplexing a BS audio TS and an HQ audio TS.

The MPEG2-TS sent to the virtual receiving apparatus 120 (FIG. 3) issupplied to the virtual decoder 121. The MPEG2-TS supplied to thevirtual decoder 121, as shown in FIG. 14, is subjected to filtering foreach type of TS packet by a filter 341.

Specifically, the MPEG2-TS is configured of multiple TS packets, andeach TS packet is appended with a PID for identifying the TS packetthereof. Based on the PID added to each packet making up the MPEG2-TS,the filter 341 supplies TS packets making up a video stream (in the caseof the example shown in FIG. 10, TS packets of PID=V0) to a video datadecoding processing unit 350 configured to process a video stream, andsupplies TS packets making up an audio stream (in the case of theexample shown in FIG. 10, TS packets of PID=a0) to an audio datadecoding processing unit 360 configured to process an audio stream, andsupplies TS packets relating to a system (in the case of the exampleshown in FIG. 10, TS packets of PID=E0) to a system data decodingprocessing unit 370 configured to process data relating to a system.

The video data decoding processing unit 350 is provided with a transportbuffer (referred to as TBv in the drawing) 351, a multiplexer buffer(referred to as MBv in the drawing) 352, an elementary buffer (referredto as EBv in the drawing) 353, a video decoder (referred to as Dv in thedrawing) 354, and an output reordering buffer (referred to as Ov in thedrawing) 355.

Upon a TS packet (in the case of the example shown in FIG. 10, TS packetof PID=V0) making up a video stream being supplied to the video datadecoding processing unit 350 via the filter 341, the TS packet is storedin the transport buffer 351. Subsequently, the data is supplied to themultiplexing buffer 352 at a predetermined bit rate. The multiplexingbuffer 352 stores the supplied data to subject this to smoothing, andthen supplies the data to the elementary buffer 353 at a predeterminedbit rate. The video decoder 354 extracts a video access unit stored inthe elementary buffer 353 at a predetermined timing, and decodes andoutputs this. Part of the decoded data is output from a terminal 356 viathe output reordering buffer 355, and the other data is output from aterminal 357, and played.

The audio data decoding processing unit 360 is provided with a transportpriority filter 361, a transport buffer (referred to as TBn in thedrawing) 362, an elementary buffer (referred to as Bn in the drawing)363, and an audio decoder (referred to as Dn in the drawing) 364.

Upon a TS packet (in the case of the example shown in FIG. 10, TS packetof PID=a0) making up an audio stream being supplied to the audio datadecoding processing unit 360 via the filter 341, the transport priorityfilter 361 subjects the TS packet to filtering depending on theperformance of the virtual decoder 121. For example, the transportpriority filter 361 performs filtering based on the value of the tp (seeFIG. 10) added to the header (e.g., TS header 282 shown in FIG. 11) ofthe TS packet. The TS packet subjected to filtering by the transportpriority filter 361 is supplied to the transport buffer 362 which is thesubsequent stage. The transport buffer 362 stores the TS packetsubjected to filtering by the transport priority filter 361 andsupplied.

The TS packet stored in the transport buffer 362 is supplied to theelementary buffer 363 at a rate Rxn depending on the performance of thevirtual decoder 121. The Rxn is a leak rate from the transport buffer362, and in the event that there is data in the transport buffer 362,the data is input to the elementary buffer 363 from the transport buffer362 at the rate Rxn. Also, in the event that there is no data in thetransport buffer 362, the Rxn becomes zero.

The elementary buffer 363 stores the data supplied at the bit rate ofthe Rxn from the transport buffer 362. Here, let us say that the size ofthe elementary buffer 363 differs depending on an audio encoding method(MPEG1 audio, MPEG2 AAC audio, etc.). Note that in the event that thereis data in the transport buffer 362, the data is supplied at the bitrate (speed) of the Rxn to the elementary buffer 363 from the transportbuffer 362, but in the event that there is no data in the transportbuffer 362, the data from the transport buffer 362 is not supplied tothe elementary buffer 363 (i.e., becomes Rxn=0).

The audio decoder 364 extracts an audio access unit stored in theelementary buffer 363 at a predetermined timing, decodes this, outputsthis via a terminal 365, and plays this. Specifically, when the PTS ofan audio access unit is equal to the time on the system clock of aT-STD, the audio decoder 364 extracts the audio access unit thereof fromthe elementary buffer 363. Note that an audio access unit is an encodingunit making up an audio stream, and also becomes a decoding unit. Notethat the details of the audio data decoding processing unit 360 shown inFIG. 14 will be described later with reference to FIG. 15.

The system data decoding processing unit 370 is provided with atransport buffer (referred to as TBsys in the drawing) 371, anelementary buffer (referred to as Bsys in the drawing) 372, and a systemdecoder (referred to as Dsys in the drawing) 373.

Upon a TS packet (TS packet of PID=E0 in the case of the example shownin FIG. 10) relating to the system being supplied to the system datadecoding processing unit 370 via the filter 341, the TS packet is storedin the transport buffer 371. The data stored in the transport buffer 371is supplied to the elementary buffer 372. The system decoder 373extracts a system access unit stored in the elementary buffer 72 at apredetermined timing, decodes this, and outputs this via a terminal 374.

Note that examples of a TS packet relating to the system include the TSpacket 221, and the TS packet 222 serving as a PMT shown in FIG. 6.

Next, the details of the audio data decoding processing unit 360 shownin FIG. 14 will be described with reference to FIG. 15.

The interior of the audio data decoding processing unit 360, as shown inFIG. 15, is divided into two systems of a BS audio data decodingprocessing unit 360-1, and an HQ audio data decoding processing unit360-2. This configuration is provided to verify the two of the BS audiodata decoding processing unit 360-1 serving as a decoder model of whichthe object to be decoded is a BS audio ES alone, and the HQ audio datadecoding processing unit 360-2 serving as a decoder model of which theobject to be decoded is an HQ audio ES at a time.

The BS audio data decoding processing unit 360-1 is provided with atransport priority filter (referred to as transport priority filter(tp=1) in the drawing) 361-1, a transport buffer (referred to as TB1 inthe drawing) 362-1, an elementary buffer (referred to as B1 in thedrawing) 363-1, and an audio decoder (referred to as D1 in the drawing)364-1. That is to say, the transport priority filter 361-1, transportbuffer 362-1, elementary buffer 363-1, and audio decoder 364-1 of theaudio data decoding processing unit 360-1 shown in FIG. 15 correspond tothe transport priority filter 361, transport buffer 362, elementarybuffer 363, and audio decoder 364 of the audio data decoding processingunit 360 shown in FIG. 14, respectively.

The transport priority filter 361-1 selects a TS packet of tp=1(Transport_priority=1) alone, and supplies this to the transport buffer362-1. The transport buffer 362-1 supplies data to the elementary buffer363-1 with the value (Rxn) of an input bit rate as to the elementarybuffer 363-1 as Rx1. The elementary buffer 363-1 stores the datasupplied at the bit rate of the Rx1 from the transport buffer 362-1.Here, let us say that the capacity (Bn) of the elementary buffer 363-1is referred to as B1. The audio decoder 364-1 extracts an audio accessunit stored in the elementary buffer 363-1 at a predetermined timing,decodes this, and outputs this. Specifically, when the PTS of an audioaccess unit is equal to the time on the system time clock of the T-STD,the audio decoder 364-1 extracts the audio access unit thereof from theelementary buffer 363-1.

Thus, the BS audio data decoding processing unit 360-1 is a virtualdecoder assuming decoding of a BS audio ES. Hereinafter, the virtualdecoder 121 of which the audio data decoding processing unit 360 issubstituted with the BS audio data decoding processing unit 360-1 willbe referred to as a first virtual decoder. That is to say, a virtualdecoder provided in the first virtual receiving apparatus will bereferred to as the first virtual decoder.

On the other hand, the HQ audio data decoding processing unit 360-2 isprovided with a transport priority filter (referred to as transportpriority filter (tp=0) in the drawing) 361-2, a transport buffer(referred to as TB2 in the drawing) 362-2, an elementary buffer(referred to as B2_1 in the drawing) 363-2, and an audio decoder 364-2of a variable bit rate. Also, the audio decoder 364-2 of a variable bitrate is provided with a FIFO buffer (referred to as B2_2 in the drawing)391, and an audio decoder (referred to as D2 in the drawing) 392. Inother words, the elementary buffer of the HQ audio data decodingprocessing unit 360-2 is divided into two (two of the elementary buffer363-2 and the FIFO buffer 391). That is to say, the transport priorityfilter 361-2, transport buffer 362-2, elementary buffer 363-2, and audiodata 364-2 of the audio data decoding processing unit 360-2 shown inFIG. 15 correspond to the transport priority filter 361, transportbuffer 362, elementary buffer 363, and audio decoder 364 of the audiodata decoding processing unit 360 shown in FIG. 14, respectively.

The transport priority filter 361-2 selects a TS packet of tp=0(Transport_priority=0) alone, and supplies this to the transport buffer362-2. The transport buffer 362-2 supplies data to the elementary buffer363-2 with the value (Rxn) of an input bit rate as to the elementarybuffer 363-2 as Rx2. The elementary buffer 363-2 stores the datasupplied at the bit rate of the Rx2 from the transport buffer 362-2.Here, the capacity (Bn) of the elementary buffer 363-2 will be referredto as B21.

The audio decoder 364-2 of a variable bit rate extracts an audio accessunit stored in the elementary buffer 363-2 at a predetermined timing,and decodes this, and outputs this. Specifically, as shown in FIG. 16,the input timing of data as to the FIFO buffer 391 of the audio decoder364-2 of a variable bit rate is determined with Input timing (timingvalue) included in an HQ audio ES. This Input timing, as described abovewith reference to FIG. 11, is a value (Input timing information 275shown in FIG. 11) to be added when the second encoder 142 encodes audiodata. That is to say, data is input to the FIFO buffer 391 at the timingbased on the Input timing (Input timing information 275 shown in FIG.11) embedded in an HQ audio ES (audio stream of a variable bit rate).Also, when the PTS of an audio access unit becomes equal to the time onthe system time clock of the T-STD, the audio decoder 392 extracts theaudio access unit thereof from the FIFO buffer 391, decodes this, andoutputs this. That is to say, the FIFO buffer 391 is employed for theaudio decoder 364-2 of a variable bit rate. Thus, the audio decoder364-2 of a variable bit rate is realized with the FIFO buffer 391 andthe audio decoder 392.

At this time, the input timing of data as to the FIFO buffer 391 isarranged to be determined based on the Input timing (timing value),which eliminates the necessity of adding a DTS (Decoding Time Stamp) toa stream, and consequently the PES-packetizing unit 136 of the sendingapparatus 111 (FIG. 4) can perform PES packetizing smoothly withoutperforming a calculation for obtaining a DTS in the event of subjectingan HQ audio ES to PES packetizing. Also, the PES-packetizing unit 136can readily perform PES packetizing only by storing the Input timingincluded in an HQ audio ES in the PES payload 253 (FIG. 11) of a PESpacket as it is beforehand. Further, the PES-packetizing unit 136 doesnot need to store a DTS value in a PES packet to be generated, wherebythe data amount of PES packets can be suppressed. That is to say, thedata amount of PES packets can be further reduced.

Thus, the HQ audio data decoding processing unit 360-2 is a virtualdecoder assuming decoding of an HQ audio ES. Hereinafter, the virtualdecoder 121 of which the audio data decoding processing unit 360 issubstituted with the HQ audio data decoding processing unit 360-2 willbe referred to as a second virtual decoder. That is to say, a virtualdecoder provided in the second virtual receiving apparatus will bereferred to as the second virtual decoder.

With the elementary buffer 363-2 (B2_1) shown in FIG. 15, the amount ofoccupied buffer is reduced at the timing based on the Input timing.Also, the FIFO buffer 391 (B2_2) does not overflow, but may underflow.Therefore, it is necessary to multiplex TS packets at timing such aspreventing the FIFO buffer 391 (B2_2) from underflow, and alsopreventing the elementary buffer 363-2 (B2_1) from overflow andunderflow.

Now, in FIG. 15, for example, let us say that the buffer size of theelementary buffer 363-1 (B1) is 18640 bytes, the buffer size of theelementary buffer 363-1 (B2_1)+the FIFO buffer 391 is 524250 bytes, theleak rate Rx1 is 2 Mbps, and the leak rate Rx2 is 48 Mbps.

The sending apparatus 111 shown in FIG. 4 needs to perform multiplexingby sequentially determining TS packets to be multiplexed from BS audioTS packets and HQ audio TS packets based on the multiplexing constraintsfor random access such that the virtual receiving apparatus 120including the virtual decoder 121 shown in FIG. 15 can perform decodingcorrectly.

That is to say, the sending apparatus 111 needs to perform multiplexingby determining (regulating) audio TS packets to be multiplexed based onthe multiplexing constraints for random access so as to prevent thetransport buffer 362-1 and the transport buffer 362-2 of the virtualdecoder 121 shown in FIG. 15 from overflow, and also prevent theelementary buffer 363-1 and the elementary buffer 363-2 from overflowand underflow, and further prevent the FIFO buffer 391 from underflow.

Therefore, the sending apparatus 111 regulates the timing ofmultiplexing arranged to multiplex the BS audio TS 173 and the HQ audioTS 183 shown in FIG. 6 to generate a transport stream 190 based on themultiplexing constraints for random access so as to satisfy the virtualdecoder 121 shown in FIG. 15 described above, i.e., so as to performdecoding with both of the BS audio data decoding processing unit 360-1and the HQ audio data decoding processing unit 360-2. That is to say,the sending apparatus 111 performs multiplexing by sequentiallydetermining TS packets to be multiplexed based on the multiplexingconstraints for random access at timing such as preventing each bufferof the first virtual receiving apparatus (the first virtual decoder,i.e., the virtual decoder including the BS audio data decodingprocessing unit 360-1) and the second virtual receiving apparatus (thesecond virtual decoder, i.e., the virtual decoder 121 including the HQaudio data decoding processing unit 360-2) from overflow and underflow.

Next, description will be made regarding processing in a case whereinthe sending apparatus 111 thus described considers the performance ofthe virtual receiving apparatus 121, and also subjects an audio streamto encoding, TS packetizing, multiplexing, and sending based on themultiplexing constraints for random access. FIG. 17 and FIG. 18 areflowcharts describing the TS packet sending processing by the sendingapparatus 111 shown in FIG. 4. Note that this processing is started whenthe power of the sending apparatus 111 is turned on, and an audio streamis input to the input unit 131.

In step S51, the input unit 131 accepts input of audio data, and outputsthe accepted audio data to the audio encoder 132. Specifically, theinput unit 131 supplies the audio data to the first encoder 141 and thesecond encoder 142 within the audio encoder 132.

In step S52, the first encoder 141 encodes the audio data using thefirst encoding method. As described above, for example, a fixed-lengthencoding method is employed as the first encoding method. The firstencoder 141 supplies the BS audio ES obtained as a result of theencoding to the first buffer 143 of the buffer 133 which is thesubsequent stage.

In step S53, the second encoder 142 encodes the audio data using thesecond encoding method. As described above, the second encoding methodis a variable-length encoding method, and the second encoder 142 addsinput timing at the time of encoding (the Input timing information 275shown in FIG. 11). The second encoder 142 supplies the HQ audio ESobtained as a result of encoding to the second buffer 144 of the buffer133 which is the subsequent stage.

Note that the BS audio ES output from the first encoder 141 in step S52corresponds to the BS audio ES 171 shown in FIG. 6, and the HQ audio ESoutput from the second encoder 142 in step S53 corresponds to the HQaudio ES 181 shown in FIG. 6.

In step S54, the first buffer 143 stores (buffers) the BS audio ES 171(see FIG. 6) supplied from the first encoder 141 of the audio encoder13.

In step S55, the second buffer 144 stores (buffers) the HQ audio ES 181(see FIG. 6) supplied from the second encoder 142 of the audio encoder13.

In step S56, the control unit 135 determines whether or not an audioaccess unit to be sent is stored in the buffer 133, and stands by untildetermination is made that there is an audio access unit in the buffer133. The control unit 135 monitors elementary streams (BS audio ES 171and HQ audio ES 181) stored in the buffer 133 (first buffer 143 andsecond buffer 144), and also manages PTSs, thereby performing thedetermination in step S56 based on these. Specifically, the control unit135 determines based on PTSs whether or not an audio access unit to besent is stored in the first buffer 143 in the case of a BS audio ES, anddetermines based on the Input timing (Input timing information 275 shownin FIG. 11) whether or not an audio access unit to be sent is stored inthe second buffer 144 in the case of an HQ audio ES.

For example, each of the audio access units of the BS audio ES 171(e.g., BS(1), BS(2), and so on through BS(n) shown in FIG. 6) isarranged to have a fixed length, so the control unit 135 determineswhether or not PTS(N)=PTS0+TT×h (“PTS0” denotes the PTS of the firstaudio access unit, “TT” denotes the display interval of access units,and h denotes the number of suffix shown with parentheses shown in FIG.6) is stored in the first buffer 143. Also, for example, each of theaudio access units of the HQ audio ES 181 (e.g., HQ(1), HQ(2), and so onthrough HQ(m) shown in FIG. 6) is arranged to have a variable length, sothe control unit 135 determines based on the Input timing added to theHQ audio ES 181 whether or not an audio access unit is stored in thesecond buffer 144. This is because with an HQ audio ES, audio accessunits have a variable length, which differ at the time of a BS audio ES,so upon control being performed with PTSs, for example, in the eventthat the size of an access unit is great, underflow may be caused due totransfer not being on time, and accordingly, it is necessary to transferan audio access unit to the audio decoder of a variable bit rate at thepoint-in-time desired with the Input timing (Input timing information275 shown in FIG. 11) which is earlier than the point-in-time of a PTS.

Note that the above-described fixed length and variable length aredefinitions as to the data size of an audio access unit, and eachdisplay interval as to one audio access unit is arranged to be constant.For example, let us say that the display interval of a BS audio ES is 32milliseconds per one access unit, and in the display interval of an HQaudio ES is 1/1200 second per one access unit.

In the event that determination is made in step S56 that there is anaudio access unit to be sent, in step S57 the control unit 135 performscontrol so as to read out an audio access unit to be sent from thebuffer 133 serving as an object, and supply this to the PES-packetizingunit 136. For example, the control unit 135 performs control so as toread out an audio access unit to be sent from the first buffer 143, andsupply this to the PES-packetizing unit 136. Also, for example, thecontrol unit 135 performs control so as to read out an audio access unitto be sent from the second buffer 144, and supply this to thePES-packetizing unit 136. Also, the control unit 135 instructs thePES-packetizing unit 136 to perform PES packetizing, and proceeds to theprocessing in step S58.

In step S58, the PES-packetizing unit 136 subjects the audio access unitsupplied in the processing in step S57 to PES packetizing. Specifically,the PES-packetizing unit 136 includes the PTS supplied from the controlunit 135 in the audio access unit (the audio access unit of a BS audioES or HQ audio ES) supplied from the first buffer 143 or the secondbuffer 144 at the processing in step S57, and subjects this audio accessunit to PES packetizing so as to satisfy the constraints. ThePES-packetizing unit 136 supplies the PES packet subjected to PESpacketizing and generated to the TS-packetizing unit 137.

For example, the PES-packetizing unit 136 obtains the BS audio ESsupplied from the first buffer 143 (obtains the audio access unitcorresponding to the PTS), and packetizes the BS audio ES to PESpackets. Also, for example, the PES-packetizing unit 136 obtains the HQaudio ES supplied from the second buffer 144 (obtains the audio accessunit corresponding to the Input timing), and packetizes the HQ audio ESto PES packets. At this time, the PES-packetizing unit 136 stores thePTS supplied from the control unit 135 in each PES packet making up aPES packet stream (e.g., BS audio PES 172 or HQ audio PES 182 shown inFIG. 6). Subsequently, the PES-packetizing unit 136 supplies thegenerated PES packet (e.g., among the BS audio PES 172 shown in FIG. 6,the PES packet subjected to PES packetizing in the processing in stepS57, or among the HQ audio PES 182 shown in FIG. 6, the PES packetsubjected to PES packetizing in the processing in step S57) to theTS-packetizing unit 137. At this time, the PES-packetizing unit 136performs PES packetizing based on the constraints at the time of PESpacketizing. The details of the PES packetizing processing will bedescribed later with reference to FIG. 19.

Note that the BS audio PES output from the PES-packetizing unit 136 instep S58 corresponds to the BS audio PES 172 shown in FIG. 6, and the HQaudio PES output from the PES-packetizing unit 136 in step S58corresponds to the HQ audio PES 182 shown in FIG. 6.

In step S59, the TS-packetizing unit 137 subjects the PES packetsupplied from the PES-packetizing unit 136 to TS packetizing, andsupplies the TS packet subjected to TS packetizing to the multiplexingunit 138. For example, the TS-packetizing unit 137 subjects the multipleBS audio PES packets making up the BS audio PES 172 to TS packetizingsuch as the multiple BS audio TS packets making up the BS audio TS 173shown in FIG. 6. Subsequently, the TS-packetizing unit 137 supplies themultiple BS audio TS packets making up the BS audio TS 173 to themultiplexing unit 138 which is the subsequent stage. Similarly, forexample, the TS-packetizing unit 137 subjects the multiple HQ audio PESpackets making up the HQ audio PES 182 to TS packetizing such as themultiple HQ audio TS packets making up the HQ audio TS 183 shown in FIG.6. Subsequently, the TS-packetizing unit 137 supplies the multiple HQaudio TS packets making up the HQ audio TS 183 to the multiplexing unit138 which is the subsequent stage.

At this time, as shown in FIG. 10, the same PID and a different value oftransport_priority are added to each TS header of the BS audio TS 173and the HQ audio TS 183 both subjected to TS packetizing. In the case ofthe example shown in FIG. 5, “PID=a0, tp=1” is included in each TSpacket of the BS audio TS 183, and “PID=a0, tp=0” is included in each TSpacket of the HQ audio TS 183.

In step S60, the control unit 135 determines TS packets to bemultiplexed based on calculation of the amount of occupied buffer of thevirtual decoder 121, and the multiplexing constraints for random access.Specifically, the control unit 135 determines TS packets to bemultiplexed next (any TS packet of a BS audio TS packet and an HQ audioTS packet) based on calculation of the amount of occupied buffer of thefirst virtual decoder and the second virtual decoder (see FIG. 14 andFIG. 15), and the multiplexing constraints for random access, andcontrols the multiplexing unit 138 to multiplex the TS packets of whichthe multiplexing is determined. That is to say, the control unit 135determines the order of TS packets to be multiplexed to multiplex the BSaudio TS 173 and the HQ audio TS 183 shown in FIG. 6 to generate atransport stream 190. Note that description will be made later regardingthe calculation processing of the amount of occupied buffer of thevirtual decoder 121 (first virtual decoder and second virtual decoder)with reference to FIG. 20 and FIG. 21, and description will be madelater regarding the multiplexing constraint processing for random accesswith reference to FIG. 22.

In step S61, of the TS packets supplied from the TS-packetizing unit137, the multiplexing unit 138 multiplexes the TS packets determined tobe multiplexed at the processing in step S60 by the control unit 135.Specifically, of the respective TS packets of the BS audio TS 173 andthe respective TS packets of the HQ audio TS 183 shown in FIG. 6, themultiplexing unit 138 (sequentially) multiplexes the TS packetsdetermined to be multiplexed at the processing in step S60. Thus, thetransport stream 190 shown in FIG. 6 is generated. The multiplexing unit138 supplies the transport stream 190 generated by multiplexing the BSaudio TS 173 and the HQ audio TS 183 to the sending unit 139.

In step S62, the sending unit 139 sends the transport stream 190 (FIG.6) supplied from the multiplexing unit 138. The sending unit 139, forexample, as shown in FIG. 3, controls the drive 112 to send a transportstream (MPEG2-TS) to the removable medium 113, or controls thecommunication unit 114 to send this to a receiving apparatus via thenetwork 115. This receiving apparatus is not the virtual receivingapparatus 120 described with reference to FIG. 3 and FIG. 14, but anunshown receiving apparatus which actually receives the MPEG2-TS(includes a decoder).

In step S63, the control unit 135 determines whether to end theprocessing. For example, the control unit 135 determines to end theprocessing, in the event of completing input of audio data to the inputunit 131, in the event of a user instructing to end the TS packetsending processing, in the event of completing sending of one audiostream, and so forth. In step S63, in the event of determining not toend the processing, the processing returns to step S51, where thesubsequent processing is repeated. That is to say, again, input of audiodata is accepted, the audio data is subjected to TS packetizing, TSpackets to be multiplexed are determined based on calculation of theamount of occupied buffer of the virtual decoder 121, and themultiplexing constraints for random access, the determined TS packetsare multiplexed, and a transport stream generated as a result of themultiplexing is sent. In step S63, in the event of determining to endthe processing, the processing ends.

According to the processing shown in FIG. 17 and FIG. 18, TS packets aremultiplexed in the order wherein the TS packets have been determined tobe multiplexed based on calculation of the amount of occupied buffer ofthe first virtual decoder and the second virtual decoder (virtualdecoder 121) described with reference to FIG. 14 and FIG. 15, and themultiplexing constraints for random access, so as long as a receivingapparatus (not shown) including a decoder compatible with a model of thevirtual decoder 121 shown in FIG. 14 and FIG. 15 is employed, atransport stream (multiple TS packets) multiplexed with this processingcan be decoded in a sure manner.

Next, the details of the PES packetizing processing executed by thePES-packetizing unit 136, which is the processing in step S58 shown inFIG. 17, will be described with reference to the flowchart shown in FIG.19.

In step S71, the PES-packetizing unit 136 determines whether or not theaudio access unit supplied from the first buffer 143 or the secondbuffer 144 (audio access unit of a BS audio ES or an HQ audio ES) is anaudio access unit of a BS audio ES. For example, in the case of theexample shown in FIG. 6, an audio access unit of the BS audio ES 171 orHQ audio ES 181 of the first stage is supplied to the PES-packetizingunit 136, so determination is made whether the supplied audio accessunit is the BS audio ES or HQ audio ES.

In the event that determination is made in step S71 that the suppliedaudio access unit is an access unit of a BS audio ES, the processingproceeds to step S72, and the PES-packetizing unit 136 determineswhether or not the access unit of the BS audio ES is an access unitsatisfying the cycle N. That is to say, the PES-packetizing unit 136determines whether or not the access unit of the BS audio ES is anaccess unit satisfying the cycle N described above with reference toFIG. 13.

In the event that determination is made in step S72 that the access unitof the BS audio ES is an access unit satisfying the cycle N, in step S73the PES-packetizing unit 136 subjects the access unit to PES packetizingsuch that the access unit appears at the head of a PES packet. At thistime, the PES-packetizing unit 136 stores the PTS supplied from thecontrol unit 135 in the PES header of the PES payload. In the exampleshown in FIG. 7, in the event that determination is made that the accessunit of the BS(1) of the BS audio ES 171 is an access unit satisfyingthe cycle N, the PES-packetizing unit 136 subjects the access unit(BS(1)) such that the access unit (BS(1)) appears at the head of the PESpayload of the PES packet 172-1. Subsequently, the PES-packetizing unit136 stores PTS=BS1 supplied from the control unit 135 in the PES headerof the PES packet 172-1.

On the other hand, in the event that determination is made in step S72that the access unit of the BS audio ES is not an access unit satisfyingthe cycle N, the processing proceeds to step S74, where thePES-packetizing unit 136 subjects the access unit to PES packetizing. Inthe example shown in FIG. 7, in the event that determination is madethat the access unit of the BS(2) of the BS audio ES 171 is not anaccess unit satisfying the cycle N, the PES-packetizing unit 136 storesthe access unit (BS(2)) in the PES payload of the PES packet 172-1,thereby performing PES packetizing.

Thus, according to the processing in step S72, step S73, and step S74,the access units of a BS audio ES can be subjected to PES packetizingsequentially. Specifically, as for an access unit of a BS audio ESsatisfying the cycle N, PES packetizing is performed such that theaccess unit appears at the head of a PES payload, and as for the otheraccess units, PES packetizing is performed without providingconstraints.

On the other hand, in the event that determination is made in step S71that the supplied audio access unit is an access unit of a BS audio ES,i.e., in the event that the audio access unit supplied to thePES-packetizing unit 136 is an audio access unit of a HQ audio ES, theprocessing proceeds to step S75, where the PES-packetizing unit 136determines whether or not the access unit of the HQ audio ES is anaccess unit satisfying the cycle N. That is to say, the PES-packetizingunit 136 determines whether or not the access unit of the HQ audio ES isan access unit satisfying the cycle N described above with reference toFIG. 13.

In the event that determination is made in step S75 that the access unitof the HQ audio ES is an access unit satisfying the cycle N, in step S76the PES-packetizing unit 136 determines whether or not the access unitis an access unit of which the header includes detailed information.Specifically, the PES-packetizing unit 136 determines whether or not thedetailed information 276 described above with reference to FIG. 11 isincluded in the header of the audio access unit.

In the event that determination is made in step S76 that the access unitis an access unit of which the header includes the detailed information276, the processing proceeds to step S77, where the PES-packetizing unit136 subjects the access unit to PES packetizing such that the accessunit appears at the head of a PES payload. At this time, thePES-packetizing unit 136 stores the PTS supplied from the control unit135 in the PES header of the PES payload. In the example shown in FIG.8, in the event that determination is made that the access unit of theHQ(1) of the HQ audio ES 181 is an access unit satisfying the cycle N(YES in step S75), the PES-packetizing unit 136 subjects the access unit(HQ(1)) such that the access unit (HQ(1)) appears at the head of the PESpayload of the PES packet 182-1. Subsequently, the PES-packetizing unit136 stores PTS=HQ1 supplied from the control unit 135 in the PES headerof the PES packet 182-1.

On the other hand, in the event that determination is made in step S75that the access unit of the HQ audio ES is not an access unit satisfyingthe cycle N, or in the event that determination is made in step S76 thatthe access unit of the HQ audio ES is an access unit of which the headerincludes the detailed information 276, the processing proceeds to stepS74, where the PES-packetizing unit 136 subjects the access unit to PESpacketizing. In the example shown in FIG. 8, in the event thatdetermination is made that the access unit of the HQ(2) of the HQ audioES 181 is not an access unit satisfying the cycle N, or in the eventthat determination is made that the access unit of the HQ(2) of the HQaudio ES 181 is an access unit satisfying the cycle N, but is not anaccess unit of which the header includes the detailed information 276,the PES-packetizing unit 136 stores the access unit (HQ(2)) in the PESpayload of the PES packet 182-1, thereby performing PES packetizing.

Thus, according to the processing in step S74 through step S77, theaccess units of an HQ audio ES can be subjected to PES packetizingsequentially. Specifically, as for an access unit of an HQ audio ES ofwhich the header includes the detailed information 276 (FIG. 11), PESpacketizing is performed such that the access unit appears at the headof a PES payload, and as for the other access units, PES packetizing isperformed without providing constraints.

The processing ends following the processing in step S73, following theprocessing in step S74, or following the processing in step S77.

Thus, the cycle N (FIG. 13) is defined such that the displaypoint-in-time of a BS audio ES access unit and the display point-in-timeof an HQ audio ES access unit are equal, and one cycle interval is equalto or shorter than one second, an BS audio ES access unit is subjectedto PES packetizing based on this cycle, and an HQ audio ES access unitis subjected to PES packetizing based on not only that cycle but alsoregarding whether or not the header includes the detailed information,whereby PES packets can be generated in light of the constraints in thecase of multiplexing and in the case of random access.

Next, description will be made with reference to FIG. 20 and FIG. 21regarding the calculation of the amount of occupied buffer of thevirtual decoder executed by the control unit 135 in step S60 shown inFIG. 18.

First, the calculation processing of the amount of occupied buffer as toBS audio will be described with reference to the flowchart shown in FIG.20. Note that this processing is processing wherein the control unit 135shown in FIG. 4 calculates the timing of multiplexing of TS packets,assuming that the virtual decoder 121 serving as the receiving side candecode a BS audio ES alone. That is to say, this processing isprocessing which the control unit 135 executes, assuming that thevirtual decoder 121 serving as the receiving side is the first virtualdecoder.

In step S101, in the event that the transport buffer 362-1 of the BSaudio data decoding processing unit 360-1 shown in FIG. 15 has space tostore a TS packet of tp=1, the control unit 135 controls themultiplexing unit 138 to multiplex the TS packet. That is to say, in theevent that the transport buffer 362-1 shown in FIG. 15 has space tostore a BS audio TS packet (TS packet corresponding to a BS audio ES),the control unit 135 controls the multiplexing unit 138 to multiplex theBS audio TS packet thereof.

In step S102, the control unit 135 perform calculation, assuming that inthe event that the elementary buffer 363-1 (Bn=B1) of the virtualdecoder 121 shown in FIG. 15 has space, data is extracted at a bit rateof Rx1 (Rxn=Rx1) from the transport buffer 362-1, and this is suppliedto the elementary buffer 363-1 (B1). As described above, the input bitrate as to the elementary buffer 363-1 of the first virtual decoder isthe Rx1, so the control unit 135 performs calculation, assuming thatdata is extracted at a rate of the Rx1, and also performs calculation,assuming that the storage capacity of the elementary buffer 363-1 isBn=B1.

In step S103, the control unit 135 performs calculation, assuming thatwhen the PTS of an audio access unit becomes equal to the time on thesystem time clock of the virtual decoder 121, the audio access unitthereof is extracted from the elementary buffer 363-1 (B1), and issupplied to the audio decoder 364-1. For example, the control unit 135performs calculation, assuming that when the system time clock of thevirtual decoder 121 becomes equal to the PTS of an audio access unit, anaudio access unit having the PTS thereof is extracted from theelementary buffer 363-1, and is supplied to the audio decoder 364-1.Subsequently, the processing ends.

Note that the processing shown in FIG. 20 is processing executed in thecase of executing the processing in step S60 shown in FIG. 18, which isrepeatedly executed.

Thus, the control unit 135 calculates the amount of occupied buffer ofthe decoder, assuming the decoder (first virtual decoder) capable ofdecoding a BS audio ES alone. That is to say, the control unit 135calculates the amount of occupied buffer of the first virtual decoder,assuming that the BS audio data decoding processing unit 360-1 shown inFIG. 15 is provided in the audio data decoding processing unit 360 shownin FIG. 14, and based on this, and later-described multiplexingconstraints for random access shown in FIG. 22, the control unit 135determines the multiplexing timing of TS packets. Thus, the decoder(actual decoder) capable of decoding a BS audio ES alone can decode a BSaudio ES in a sure manner while causing the amount of occupied buffer toneither overflow nor underflow.

Next, the calculation processing of the amount of occupied buffer as toHQ audio will be described with reference to the flowchart shown in FIG.20. Note that this processing is processing wherein the control unit 135shown in FIG. 4 calculates the timing of multiplexing of TS packets,assuming that the virtual decoder 121 serving as the receiving side candecode an HQ audio ES. That is to say, this processing is processingwhich the control unit 135 executes, assuming that the virtual decoder121 serving as the receiving side is the second virtual decoder.

In step S151, in the event that the transport buffer 362-2 of the HQaudio data decoding processing unit 360-2 shown in FIG. 15 has space tostore a TS packet of tp=0, the control unit 135 controls themultiplexing unit 138 to multiplex the TS packet. That is to say, in theevent that the transport buffer 362-2 shown in FIG. 15 has space tostore an HQ audio TS packet (TS packet corresponding to an HQ audio ES),the control unit 135 controls the multiplexing unit 138 to multiplex theHQ audio TS packet thereof.

In step S152, the control unit 135 perform calculation, assuming that inthe event that the elementary buffer 363-2 (En=B2_1) of the virtualdecoder 121 shown in FIG. 15 has space, data is extracted at a bit rateof Rx2 (Rxn=Rx2) from the transport buffer 362-2, and this is suppliedto the elementary buffer 363-2 (B2_1). As described above, the input bitrate as to the elementary buffer 363-2 of the second virtual decoder isthe Rx2, so the control unit 135 performs calculation, assuming thatdata is extracted at a rate of the Rx2, and also performs calculation,assuming that the storage capacity of the elementary buffer 363-2 isBn=B2_1.

In step S153, the control unit 135 performs calculation, assuming thatbased on the Input timing of an audio access unit, the audio access unitthereof is extracted from the elementary buffer 363-2 (B2_1), and issupplied to the FIFO buffer 391 (B2_2). As described above, the Inputtiming (see FIG. 11) is added to the HQ audio ES encoded and output bythe second encoder 142, so the control unit 135 performs calculation,assuming that based on this Input timing, an audio access unit isextracted from the elementary buffer 363-2 (B2_1), and is supplied tothe FIFO buffer 391 (B2_2).

In step S154, the control unit 135 performs calculation, assuming thatbased on the PTS of an audio access unit, the audio access unit thereofis extracted from the FIFO buffer 391 (B2_2), and is supplied to theaudio decoder 392. Specifically, the control unit 135 performscalculation, assuming that when the PTS of an audio access unit becomesequal to the time on the system time clock of the virtual decoder 121(second virtual decoder), the audio access unit thereof is extractedfrom the FIFO buffer 391, and is supplied to the audio decoder 392.Subsequently, the processing ends.

Thus, with the elementary buffer 363-2 (B2_1), the amount of occupiedbuffer develops at the timing based on the Input timing. Also, the FIFObuffer 391 (B2_2) does not overflow, but may underflow. Therefore, it isnecessary to multiplex TS packets at timing such as preventing the FIFObuffer 391 (B2_2) from underflow, and also preventing the elementarybuffer 363-2 (B2_1) from overflow and underflow.

Next, description will be made with reference to the flowchart shown inFIG. 22 regarding the multiplexing constraint processing for randomaccess executed by the control unit 135 in step S60 shown in FIG. 18.Note that this processing is processing wherein the control unit 135shown in FIG. 4 constrains the multiplexing timing of TS packets inlight of an EP_map created for random access (the details will bedescribed later).

In step S201, the control unit 135 determines whether or not within a BSaudio TS and an HQ audio TS there is a TS packet including an HQ audioPES packet having the same PTS value as the PTS value of the PES headerincluded in the TS payload of a BS audio TS packet. For example, thecontrol unit 135 determines whether or not within the BS audio TS 173and the HQ audio TS 183 there is a TS packet including an HQ audio PESpacket having the same PTS value as PTS=BS1 which is the PTS value ofthe PES header (BS audio PES packet 172-1 shown in FIG. 7) included inthe payload of the BS audio TS packet shown in FIG. 7. In the event ofPTS=BS1 (FIG. 7)=HQ1 (FIG. 8), the control unit 135 determines thatwithin the BS audio TS 173 and the HQ audio TS 183 there is a TS packet(HQ audio TS packet 232-1 shown in FIG. 8) including an HQ audio PESpacket having the same PTS value (BS1=HQ1) as the PTS value (BS1) of thePES header included in the TS payload of a BS audio TS packet.

A more specific example will be described with reference to FIG. 9. ThePTS values of PES headers are stored in the BS audio TS packets 231-1,231-3, and 231-j-1. Similarly, the PTS values of PES headers are storedin the HQ audio TS packets 232-1, 232-4, and 232-k-2. Now, let us saythat PTS#1=BS1=HQ1 and PTS#2=BS2 n′=HQm′ hold, and BS2 and HQ2 differ.At this time, determination is made that within the BS audio TS 173 andthe HQ audio TS 183 there is the TS packet 232-1 including an HQ audioPES packet having the same PTS value (PTS#1=HQ1) as the PTS value(PTS#1=BS1) of the PES header included in the TS payload of the BS audioTS packet 231-1. On the other hand, BS2 and HQ2 are not equal, sodetermination is made that within the BS audio TS 173 and the HQ audioTS 183 there is no TS packet including an HQ audio PES packet having thesame PTS value as the PTS value (BS2) of the PES header included in theTS payload of the BS audio TS packet 231-3.

In the event that determination is made in step S201 that within a BSaudio TS and an HQ audio TS there is a TS packet including an HQ audioPES packet having the same PTS value as the PTS value of the PES headerincluded in the TS payload of a BS audio TS packet, the processingproceeds to step S202, where the control unit 135 determines the TSpacket including a BS audio PES packet as a TS packet to be multiplexedprior to the TS packet including an HQ audio PES packet. For example, inFIG. 9, in the event that determination is made that within the BS audioTS 173 and the HQ audio TS 183 there is the TS packet 232-1 including anHQ audio PES packet having the same PTS value (PTS#1=HQ1) as the PTSvalue (PTS#1=BS1) of the PES header included in the TS payload of the BSaudio TS packet 231-1, in step S202 the control unit 135 determines theTS packet 231-1 including the BS audio PES packet 172-1 (see FIG. 7) asa TS packet to be multiplexed prior to the TS packet 232-1 including theHQ audio PES packet 182-1 (see FIG. 8).

In the event that determination is made in step S201 that within a BSaudio TS and an HQ audio TS there is no TS packet including an HQ audioPES packet having the same PTS value as the PTS value of the PES headerincluded in the TS payload of a BS audio TS packet, or following theprocessing in step S202, the processing ends.

According to the processing shown in FIG. 22, let us say that in theevent that the PTS values included in a BS audio TS packet and an HQaudio TS packet are equal, as for the TS packets including the PESpacket thereof, the BS audio TS packet is multiplexed prior to the HQaudio TS packet.

Note that the processing shown in FIG. 22 is processing executed in thecase of executing the processing in step S60 shown in FIG. 18, which isrepeatedly executed.

Thus, the control unit 135 executes the multiplexing constraintprocessing for random access. Accordingly, an EP_map which is createdfor random access can be created, whereby a TS can be multiplexed so asto enable random access. Thus, the actual decoder can decode a BS audioES in a sure manner while causing the amount of occupied buffer toneither overflow nor underflow, and also be capable of random access.

Note that the processing shown in FIG. 21 and FIG. 22 is processingexecuted in the case of executing the processing in step S60 shown inFIG. 18, and is repeatedly executed. That is to say, in the event ofexecuting the processing in step S60 shown in FIG. 18, the processingshown in FIG. 20, the processing shown in FIG. 21, and the processingshown in FIG. 22 is executed in parallel. More specifically, in theevent of executing the processing in step S60 shown in FIG. 18, thecontrol unit 135 calculates the multiplexing timing of TS packetscorresponding to BS audio by the processing shown in FIG. 20, and alsocalculates the multiplexing timing of TS packets corresponding to HQaudio by the processing shown in FIG. 21, and further repeatedlyexecutes the multiplexing constraint processing for random access by theprocessing shown in FIG. 22.

In other words, the control unit 135 determines (regulates) audio TSpackets to be multiplexed such as preventing the transport buffer 362-1and the transport buffer 362-2 from overflow, and also preventing theelementary buffer 363-1 and the elementary buffer 363-2 from overflowand underflow, and further preventing the FIFO buffer 391 fromunderflow, of the virtual decoder 121 shown in FIG. 15.

Thus, the control unit 135 calculates the amount of occupied buffer ofthe decoder, assuming a virtual decoder capable of decoding a BS audioES (first virtual decoder), and a virtual decoder capable of decoding anHQ audio ES (second virtual decoder), and also executes the multiplexingconstraint processing for random access to determine TS packets to bemultiplexed (determine the order of TS packets to be multiplexed). Thus,even with a decoder (actual decoder) capable of decoding a BS audio ESalone, and even with a decoder (actual decoder) capable of decoding anHQ audio ES, decoding can be performed in a sure manner while causingthe amount of occupied buffer to neither overflow nor underflow. Also,random access can be performed as to the multiplexed TS 190.

That is to say, even in the event that the actual receiving apparatus,which receives the TS packets (MPEG2-TS) multiplexed by the sendingapparatus, can actually decode a BS audio ES alone or can decode an HQaudio ES, decoding can be performed smoothly while causing the bufferincluded in each receiving apparatus to neither overflow nor underflow.

Note that a BS audio ES and an HQ audio ES are identifiable with thevalue of the transport_priority (tp) such as shown in FIG. 10, but havea mutually independent relation, so there is no constraint in the caseof multiplexing a BS audio ES and an HQ audio ES. Therefore, a BS audioES and an HQ audio ES can be handled as independent streams.

Next, an example will be described wherein an EP_map for random accessis created using the MPEG2-TS sent by the processing shown in FIG. 17and FIG. 18. For example, description will be made regarding processingin the case of a Clip AV stream file generated based on the MPEG2-TSbeing recorded in a recording medium, and also in the case of an EP_mapfor random access being created and recorded based on the Clip AV streamfile thereof.

FIG. 23 is a block diagram illustrating a configuration example of arecording apparatus 501 which creates and records an EP_map based on theClip AV stream file recorded in an optical disc 511.

The recording apparatus 501 is provided with an optical disc 511, acontroller 521, an operation input unit 523, an AV (Audio Visual)encoder 524, a buffer 525, a recording control unit 526, a drive 527,and a removable medium 528.

The controller 521 executes a control program prepared beforehand,thereby controlling the overall operation of the recording apparatus501. For example, the controller 521 can control processing arranged torecord an EP_map and so forth which enables a later-described playbackapparatus (playback apparatus 641 shown in FIG. 30) to randomly accessto the optical disc 511 based on the Clip AV stream file recorded in theoptical disc 511 which is a mounted recording medium.

The operation input unit 522 is configured of an input device, forexample, such as buttons, keys, a touch panel, a jog dial, a mouse andso forth, and a receiving unit configured to receive a signal such asinfrared rays sent from a predetermined remote commander, which obtainsthe operation input of a user to supply this to the controller 521.

The data obtaining unit 523 externally obtains AV data, i.e., video dataand audio data, and supplies these to the AV encoder 524. The AV encoder524 encodes the supplied video data and audio data with eachpredetermined encoding method, and supplies a video ES (elementarystream) and an audio ES to the buffer 525. The buffer 525 temporallybuffers the encoded data, and supplies this to the recording controlunit 526 at a predetermined timing.

The recording control unit 526 records the data (MPEG2-TS) supplied fromthe buffer 525 or controller 521 in the optical disc 511 in accordancewith the control by the controller 521.

Also, for example, the operation input unit 522 accepts input ofspecification of a predetermined playback zone among an AV stream from auser, and supplies this to the controller 521. On the other hand, thecontroller 521 creates the database of AV streams (Clip), the databasewherein playback zones of an AV stream (PlayItems) are grouped(PlayList), and the management information of the recorded contents ofthe optical disc 511 (index.bdmv and MovieObject.bdmv). Applicationdatabase information made up of such information is input to therecording control unit 526, as with an AV stream. The recording controlunit 526 records a database file in the optical disc 511 based on thecontrol signal output from the controller 521.

Also, the controller 521 is connected with the drive 527 as necessary,and the drive 527 is mounted with, for example, a magnetic disk(including a flexible disk), an optical disc (CD-ROM (Compact Disc-ReadOnly Memory), including DVD), a magneto-optic disk (MD (registeredtrademark), including Mini-Disk), or the removable medium 528 made up ofsemiconductor memory or the like.

It is needless to say that a magnetic disk or semiconductor memory, forexample, may be employed as a recording medium configured to recordcontents, besides the optical disc 511.

FIG. 24 is a diagram illustrating an application format example on theoptical disc 511 to be mounted on the recording apparatus 501 shown inFIG. 23, or a later-described playback apparatus 641 shown in FIG. 30.

An application format includes the two layers of a PlayList and a Cliparranged to manage AV streams. Here, a pair of an AV stream and Clipinformation accompanied therewith are taken as one object, which arecollectively called Clip. Also, Clip information is also referred to asa Clip information file.

One AV stream file stores data wherein an MPEG (Moving Picture ExpertGroup) 2 transport stream is disposed in the structure stipulated withthe application format. In general, a file employed for a computer andso forth is handled as a byte row, the contents of an AV stream file isrendered on the temporal axis, and an access point of a Clip isprincipally a time stamp, which is specified with a PlayList. That is tosay, a PlayList and a Clip are layers arranged to manage AV streams.

In the event that an access point within a Clip is a time stamp, whichis indicated with a PlayList, a Clip information file (e.g., EP_map) isemployed for searching address information to start decoding within anAV stream file with reference to the time stamp.

A PlayList is a group of playback zones of an AV stream. One playbackzone within a certain AV stream is referred to as a PlayItem, which isrepresented with a pair of an IN point (playback start point) and an OUTpoint (playback end point) of a PlayItem on the temporal axis.Accordingly, a PlayList is made up of one or multiple PlayItems such asshown in FIG. 24.

In FIG. 24, the leftmost PlayList is made up of two PlayItems, andaccording to the two PlayItems thereof, the first half portion and thelatter half portion of an AV stream included in the left-hand side Clipare each referenced. Also, the second PlayList from the left side ismade up of one PlayItem, whereby the entire AV stream included in theleft-side Clip is referenced. Further, the third PlayList from the leftis made up of two PlayItems, and according to the two PlayItems thereof,a certain portion of an AV stream included in the left-side Clip, and acertain portion of an AV stream included in the right-side Clip are eachreferenced.

For example, in the event that the left-side PlayItem included in theleftmost PlayLIst is specified by a user as information indicating theplayback position at that time using a disc navigation program shown inFIG. 24, the first half portion of the AV stream included in theleft-side Clip to which the PlayItem thereof refers is played. Thus, aPlayList is employed as playback management information arranged tomanage the playback of an AV stream file.

The disc navigation program includes a function arranged to control theorder of playback of a PlayList, and interactive playback of a Playlist.Also, the disc navigation program also includes a function arranged todisplay a menu screen configured to allow a user to execute varioustypes of playback, and so forth. This disc navigation program is, forexample, described with a program language such as Java (registeredtrademark), and prepared on a recording medium.

With the present embodiment, of a PlayList, a playback path created withone or more PlayItem rows (continuous PlayItems) is referred to as amain path, and a playback path created with one or more sub path rows(discontinuous or continuous SubPlayItems) in parallel (concurrent) witha main path is referred to as a sub path. That is to say, an applicationformat on a recording medium to be mounted on the recording apparatus501 or a playback apparatus (a playback apparatus 641 described laterwith reference to FIG. 30) has a sub path to be played, correlated(together) with a main path, within a PlayLIst.

Next, description will be made regarding a Clip information file (Clipinformation shown in FIG. 24). The recording apparatus 501 according tothe present embodiment records one Clip AV stream, and the Clipinformation file corresponding thereto in the optical disc 511 asseparate files. Here, a Clip AV stream is a file into which the MPEG-TSsent in the above-mentioned processing shown in FIG. 17 and FIG. 18 isconverted. A Clip information file includes CPI (Characteristic PointInformation) and a ClipMark.

CPI is data included in a Clip information file, and is principallyemployed for finding a data address from which read-out of data of aClip AV stream file should be started. With the present embodiment, CPIof the type of EP_map is employed.

FIG. 25 is a diagram describing the relation between an EP_map and aClip AV stream.

An EP_map is a list of entry point (EP) data, which is data extractedfrom an elementary stream and a transport stream. This has addressinformation for finding the place of an entry point from which decodingshould be started of an AV stream. One piece of EP data is made up of apair of a presentation time stamp (PTS), and the data address of the AVstream of the access unit corresponding to the PTS thereof.

An EP_map is principally employed for the sake of two objects. Firstly,an EP_map is employed for finding the data address of the AV stream ofan access unit to be referred with a presentation time stamp of aPlayList. A case of random access playback also corresponds to this.Secondarily, an EP_map is employed for fast forward playback or fastreverse playback. When the recording apparatus 501 records an AV stream,or analyzes the syntax of an AV stream, an EP_map is created, andrecorded in the disc.

As shown in FIG. 25, when an access point within a Clip is specifiedwith a presentation time stamp (PTS), an EP_map is employed for findingaddress information from which decoding of a stream of a Clip AV streamfile should be started. Thus, an EP_map is a table indicating an addresscorresponding to an IN point and an OUT point on the temporal axis shownwith the above-mentioned PlayList, and is employed for converting apresentation time stamp (PTS) such as a PlayList or the like into anaddress corresponding thereto. That is to say, an EP_map is a table,whereby a presentation time stamp (PTS), and the source packet number ofa Clip AV stream (the TS (Transport Stream) packet number of a transportstream) are correlated with each other.

According to this EP_map, the corresponding data can be selected andread out from a Clip AV stream. Also, an EP_map is employed in the caseof performing random access. For example, in the event that a userinputs an operation to the operation input unit 522 to specify an accesspoint within a Clip using a time stamp (PTS), the controller 521 obtainsaddress information from which decoding of a stream within a Clip AVstream file should be started with reference to an EP_map, and controlsthe recording control unit 526 to perform random access based on this.Note that as for the types of EP_map, there are a video EP_map and anaudio EP_map.

FIG. 26 is a diagram describing the configuration of an audio EP_map.Specifically, FIG. 26(A) is a diagram describing the position of apresentation time stamp (PTS) according to a Clip AV stream, FIG. 26(B)is a diagram enlarging and illustrating a part of the Clip AV streamshown in FIG. 26(A), and FIG. 26(C) is a diagram illustrating the dataconfiguration of an audio EP_map.

An audio EP_map, as shown in FIG. 26(C), is a table in which thepresentation time stamp (PTS) of a Clip AV stream (PTS_EP_start) andinformation indicating the source packet number (TS packet number)corresponding thereto (SPN_EP_start) are described.

Here, as for the expression of an address, a source packet number (SPN)can be employed. With the source packet numbers (SPN), a series ofnumbers are assigned to all the source packets in a Clip AV stream. Withthe source packet numbers SPN, let us say that of a Clip AV stream, thesource packet number SPN of the first source packet is set to zero(SPN=0), the source packet number SPN of the next source packet is setto 1 (SPN=1), and so on, i.e., the source packet number SPN increases byone for each next packet. Accordingly, as for the SPN_EP_start of anaudio EP_map, a source packet number (SPN) is described.

Next, description will be made with reference to FIG. 27 regarding anEP_map example generated based on the TS 190 (see FIG. 6 and FIG. 9)multiplexed and generated with the processing shown in FIG. 17 and FIG.18.

FIG. 27 illustrates an EP_map example of the TS 190 in the case ofmultiplexing the BS audio TS 173 and the HQ audio TS 183. That is tosay, as for audio, the two types of audio ES of the BS audio TS 173 andthe HQ audio TS 183 are included.

In the case of the example shown in FIG. 27, a Clip AV stream is made upof the TS packets of the BS audio ES and the HQ audio ES. At this time,in the event that an HQ audio TS packet having the same PTS value as thePTS value (of the PES packet) of a BS audio TS packet exists after theBS audio TS packet, the BS audio TS packet can become an entry point. Atthis time, in the event that multiplexing has been performed so as tosatisfy the above-mentioned constraint shown in FIG. 22, with regard tothe audio TS packets having the same PTS value, consequently the BSaudio TS packet exists before the HQ audio TS packet.

The SPN_EP_start is information indicating the entry point of a sourcepacket (TS packet), and in FIG. 27, the position of the BS audio TSpacket 311-1 shown with the arrow of the SPN_EP_start is indicated withthe SPN_EP_start. With the TS shown in FIG. 27, in the order from the TSpacket shown in the SPN_EP_start, the BS audio TS packets 311-1 and311-2, and the HQ audio TS packets 321-1 through 321-4 are disposed.

Now, the multiple TS packets stored in a Clip AV stream file include themultiple PES packets (Packetized Elementary Stream). Therefore, from themultiple TS packets (seven TS packets in the example shown in FIG. 27),as shown in FIG. 27, PES packets (in the example shown in FIG. 27, threePES packets) can be extracted. The PES packets shown in FIG. 27 are PESpackets extracted from the multiple TS packets including the TS packetserving as the entry point of source packets. In more detail, let us saythat the headmost data of the PES packets shown in FIG. 27 is includedin the TS packet serving as the entry point of the source packets. Inthe case of this example, the PES packets extracted from the TS packets311-1, 311-2, 321-1 through 321-4 including the TS packet serving as theentry point of the source packets are PES packets 301 through 303. ThePES packets 301 through 303 are each made up of a PES header and a PESpayload.

The PES packet 301 is obtained by subjecting the BS audio ES to PESpacketizing, and the PES packets 302 and 303 are obtained by subjectingthe HQ audio ES to PES packetizing. The PES packet 301 is made up of aPES header 301-1 and a PES payload 301-2, the PES packet 302 is made upof a PES header 302-1 and a PES payload 302-2, and the PES packet 303 ismade up of a PES header 303-1 and a PES payload 303-2. At this time, theBS audio ES data is stored in the PES payload 301-2 of the PES packet301, and the HQ audio ES data is stored in the PES payloads 302-2 and303-2 of the PES packets 302 and 303.

Now, let us say that the PTS stored in the PES header 301-1 of theheadmost PES packet 301 is PTS_EP_start (the PTS value of the PESpacket). That is to say, let us say that SPN_EP_start is the sourcepacket number of the TS packet 311-1 including the first byte of the PESpacket 301 referred to by the PTS_EP_start.

The PES payload 301-2 of the PES packet 301 includes multiple audioaccess units (BS Audio AU) serving as the BS audio ES. In the case ofthe example shown in FIG. 27, the BS audio ES is encoded with afixed-length encoding method (first encoding method), so the size ofeach audio access unit is fixed. The PES payload 302-2 of the PES packet302 includes multiple audio access units (HQ Audio AU) serving as the HQaudio ES. In the case of the example shown in FIG. 31, the HQ audio ESis encoded with a variable-length encoding method (second encodingmethod), so the size of each audio access unit is variable. Now, let ussay that the PTS value included in the PES header 302-1 of the PESpacket 302 (the PTS value obtained from the BS audio TS packet 311-1indicated with PTS_EP_start), and the PTS value included in the PESheader 301-1 of the PES packet 301 are the same. The PES payload 303-2of the PES packet 303 includes multiple audio access units serving asthe HQ audio ES. In the case of the example shown in FIG. 27, the HQaudio ES is encoded with a variable-length encoding method, so the sizeof each audio access unit is variable.

Thus, the PTS_EP_start represents the PTS value of the PES packet, andthe SPN_EP_start is the source packet number of the TS packet 311-1including the first byte of the PES packet 301 referred to by thePTS_EP_start.

Next, description will be made with reference to the flowchart shown inFIG. 28 regarding processing arranged to create and record a Clipinformation file relating to a Clip AV stream file recorded in theoptical disc 511. This processing is started, for example, by thesending apparatus 111 shown in FIG. 4 in a state in which a Clip AVstream file is recorded in the optical disc 511. That is to say, thisprocessing is started in a state wherein the recording apparatus 501shown in FIG. 23 is mounted with the optical disc 511 in which a Clip AVstream file into which the TS 190 made up of the BS audio TS packets andthe HQ audio TS packets (TS satisfying the above-mentioned constraints)was converted is recorded.

In step S311, the recording control unit 526 reads out the Clip AVstream file recorded in the optical disc 511, and supplies this to thecontroller 521. The readout Clip AV stream file is a file into which theMPEG2-TS multiplexed and generated as a result of processing in FIG. 17through FIG. 22 was converted.

In step S312, the controller 521 creates ClipInfo regarding the Clip AVstream file. ClipInfo( ) is information arranged to store the attributeinformation of the AV stream file (Clip AV stream) correspondingthereto.

In step S313, the controller 521 creates SequenceInfo regarding the ClipAV stream file.

In step S314, the controller 521 creates ProgramInfo regarding the ClipAV stream file.

In step S315, the controller 521 creates CPI (EP_map) regarding the ClipAV stream file. Specifically, the controller 521 cerates an EP_mapincluded in the CPI( ) of the Clip information file. Note that thedetails of this processing will be described with reference to FIG. 29.

In step S316, the controller 521 creates ClipMark regarding the Clip AVstream file.

In step S317, the controller 521 records a Clip information file inwhich the ClipInfo( ) SequenceInfo( ), ProgramInfo( ) CPI( ) andClipMark( ) are stored.

According to the processing shown in FIG. 28, a Clip information filecan be created and recorded based on a Clip AV stream file.

Note that in FIG. 28 each processing has been described in time-seriesorder, but the processing in step S312 through step S316 actuallyoperates concurrently.

Next, description will be made with reference to the flowchart shown inFIG. 29 regarding the details of processing arranged to create an EP_mapin step S315 shown in FIG. 32. Note that this processing is started in astate wherein the recording apparatus 501 shown in FIG. 1 is mountedwith the optical disc 511 in which the TS 190 such as described withreference to FIG. 6, FIG. 9, or FIG. 27 is recorded. That is to say,this processing is started in state wherein the recording medium 501 ismounted with the optical disc 511 in which the TS 190 made up of the BSaudio ES and the HQ audio ES is recorded.

In step S351, the recording control unit 526 reads out a Clipinformation file recorded in the optical disc 511, and accepts input ofthe TS 190 made up of the BS audio ES and the HQ audio ES. The TS, asdescribed above, has a configuration shown in FIG. 6, FIG. 9, and FIG.27, and is made up of the TS packets of the HQ audio ES and the TSpackets of the HQ audio ES. The TS of which the input is accepted ismade up of multiple TS packets, so these TS packets are sequentiallysupplied to the controller 521.

In step S352, the controller 521 obtains the TS packet supplied from therecording control unit 526, and determines whether or not this TS packetis the TS packet of the BS audio ES. The TS packet, as shown in FIG. 27,is the BS audio TS packet 311-1 (the TS packet of the BS audio ES), orthe HQ audio TS packet 321-1 (the TS packet of the HQ audio ES), so thecontroller 521 determines whether or not the obtained TS packet is theTS packet of the BS audio ES. The header of each TS packet is added witha transport_priority flag (tp flag) arranged to identify whether the TSpacket thereof is the TS packet of the BS audio ES or the TS packet ofthe HQ audio ES, so the controller 521 determines this based on the tpflag added to the header of the TS packet. For example, when the tp flagis 1, the controller 521 determines that the TS packet thereof is the TSpacket of the BS audio ES.

In step S352, in the event that determination is made that the TS packetthereof is not the TS packet of the BS audio ES, the processing returnsto step S352, where the subsequent processing is repeated. That is tosay, in the event of the TS packet of the BS audio ES, the processing instep S352 and on is executed.

In step S352, in the event that determination is made that the TS packetthereof is the TS packet of the BS audio ES, the processing proceeds tostep S353, where the controller 521 obtains the PTS value of the PESpacket from the payload of the TS packet. Now, a TS packet is made up ofa TS header and a TS payload, and the data of a PES packet is stored inthe TS payload. Therefore, for example, the TS payload of the TS packet311-1 shown in FIG. 27 includes the PES header 301-1, so the controller521 obtains the PTS value stored in the PES header 301-1. For example,the controller 521 obtains PTS#1 as a PTS value.

Note that one PES packet is made up of multiple TS packets, so the TSpacket to be processed includes no PES header in some cases. Therefore,for example, in the event that the payload of the TS packet includes noPES header but a PES payload alone, the processing returns to step S352,the next TS packet is obtained, and the subsequent processing thereof isrepeated.

In step S354, the controller 521 determines whether or not the TS packetincluding the PES packet of the HQ audio ES having the same PTS value asthe obtained PTS (e.g., PTS#1) exists after the TS, and also theheadmost access unit includes a header of the detailed information(detailed information 276 shown in FIG. 11). First, the controller 521,for example, determines whether or not the TS packet including the PESpacket of the HQ audio ES having the same PTS value as the PTS#1obtained at the processing in step S353 exists after the TS (i.e., withthe TS, after the TS packet obtained at the processing in step S352). Inother words, the controller 521 determines whether or not the TS packetof the HQ audio ES having the PTS#1 exists at a position in the TS afterthe TS packet of the BS audio ES where the PTS#1 was obtained.Subsequently, next, in the event of the above-mentioned determinationresult is positive (YES) (in the event that the TS packet of the HQaudio ES having the PTS#1 exists at a position in the TS after the TSpacket of the BS audio ES where the PTS#1 was obtained), the controller521 further determines whether or not the PES payload 302-2 (in moredetail, the header of the PES payload 302-2) of the HQ audio TS packethaving the PTS #1 thereof includes the detailed information (thedetailed information 276 shown in FIG. 11). That is to say, thecontroller 521 determines whether or not the above-mentioned placementdescribed with FIG. 12 is satisfied, and further the PES payloadextracted from the HQ audio TS packet having the same PTS includes thedetailed information 276 (FIG. 11). Note that multiplexing and PESpacketizing are performed so as to satisfy the above-mentionedconstraints for this reason.

In the event that determination is made in step S354 that no TS packetincluding the PES packet of the HQ audio ES having the same PTS value asthe obtained PTS (e.g., PTS#1) exists after the TS, or in the event thatdetermination is made that the headmost access unit includes no headerof the detailed information 276, the processing returns to step S352,where the subsequent processing and on is repeated. That is to say, inthe event that both these two conditions are not satisfied (in the caseof YES), the processing proceeds to step S355.

In the event that determination is made in step S354 that the TS packetincluding the PES packet of the HQ audio ES having the same PTS value asthe obtained PTS (e.g., PTS#1) exists after the TS, and also theheadmost access unit includes a header of the detailed information, instep S355 the controller 521 takes the current TS packet as an entrypoint. For example, the controller 521 takes the TS packet 311-1 shownin FIG. 27 as an entry point. That is to say, in the event of the PTSvalue being matched, and also in the event that a BS audio TS packethaving the matched PTS is disposed after an HQ audio TS packet havingthe matched PTS, and also the PES payload obtained from the HQ audio TSpacket includes the detailed information 276, the BS audio TS packetthereof is taken as an entry point.

Thus, the detailed information is included in the HQ audio TS packethaving the same PTS as the PTS serving as an entry point, whereby thedetailed information can be obtained smoothly in the case of playing HQaudio, and consequently, playback can be performed rapidly.

In step S356, the controller 521 creates an EP_map based on the PIDs ofthe BS audio ES and the HQ audio ES, the number of the TS packet, andthe PTS value obtained in the processing in step S353. Now, let us saythat a PID, as described above, is added when performing TS packetizing,and the PIDs of the BS audio ES and the HQ audio ES are the same (e.g.,PID=a0). Therefore, for example, the controller 521 creates an EP_mapbased on PID=a0, the number of the TS packet (the source packet numberof the BS audio TS packet 311-1 shown in FIG. 27), and the PTS#1.

In step S357, the controller 521 determines whether or not the TS packetcurrently being processed is the last TS packet. In the event that theTS packet currently being processed is not the last TS packet, i.e., inthe event that determination is made that there is a TS packet which hasnot been processed, the processing returns to step S352, where thesubsequent processing and on is repeated. That is to say, the processingis repeated until the last TS packet is processed. In the event thatdetermination is made in step S357 that the TS packet currently beingprocessed is the last TS packet, the processing ends.

An EP_map can be generated by the processing shown in FIG. 29.

Next, description will be made regarding a case of playing the Clip AVstream file recorded in the optical disc 511, and the Clip informationfile (Clip) recorded in the optical disc 511 by the processing shown inFIG. 28. FIG. 30 is a block diagram illustrating a configuration exampleof the playback apparatus 641 configured to play the data recorded inthe optical disc 511.

A controller 651 controls the overall operations of a playback apparatus641, based on a user's operation input through an operation input unit652, by executing a control program prepared beforehand, or controllinga playback control unit 654 to read out a control program recorded inthe optical disc 511, render this in memory 653, and execute this. Forexample, the controller 651 can display a predetermined menu screen onan external display device when the optical disc 311 is mounted.

The operation input unit 652 is made up of an input device, for example,such as buttons, keys, a touch panel, a jog dial, a mouse and so forth,and a receiving unit configured to receive signals such as infrared rayssent from a predetermined remote commander, and obtains a user'soperation input to supply this to the controller 651.

The memory 653 stores data necessary for the controller 651 executingvarious types of processing as appropriate.

The playback control unit 654 reads out data from the optical disc 511,and outputs this to a buffer 655 to supply the readout data to thecontroller 651, memory 653, or an AV decoder 656 in accordance with thecontrol by the controller 651. In the event that information read outfrom the optical disc 511 is a control program, control information, ora Clip information file (EP_map), or the like, the information read outby the playback control unit 654 is output to the controller 651 ormemory 653. In the event that the information read out from the opticaldisc 511 is AV data such as an AV stream file or the like, theinformation read out by the playback control unit 654 is output to thebuffer 655 to supply this to the AV decoder 656.

The buffer 655 temporarily buffers AV data such as an AV stream or thelike read out from the optical disc 511 by the playback control unit654, and supplies this to the AV decoder 656. Note that the AV stream isactually made up of the TS 190, so the controller 651 obtains a PES fromthe TS, and further obtains an ES. A BS audio ES, HQ audio ES, and videoES are included in this ES.

The AV decoder 656 decodes AV data such as the AV stream or the likesupplied from the playback control unit 654, and outputs the obtainedvideo signal and audio signal to an external display device.Specifically, an encoded BS audio ES, HQ audio ES, and video ES areincluded in this AV stream.

The AV decoder 656 is, for example, as shown in FIG. 31, in the case ofan AV decoder including a first audio decoder 656-1 configured to decodean audio ES encoded with the first encoding method, and a video decoder656-3 configured to decode a video ES, or as shown in FIG. 32, in thecase of an AV decoder including a second audio decoder 656-2 configuredto decode an audio ES encoded with the second encoding method, and avideo decoder 656-3 configured to decode a video ES.

That is to say, the AV decoder 656 shown in FIG. 31, as for audio, candecode a BS audio ES alone, but cannot decode an HQ audio ES. The AVdecoder 656 shown in FIG. 32, as for audio, can decode an HQ audio ES.Note that the AV decoder 656 shown in FIG. 32 includes the second audiodecoder 656-2 which has higher performance than the first audio decoder656-1, so can of course decode a BS audio ES, but it is common for adecoder to play audio with higher performance, and accordingly,description will be made assuming that the AV decoder 656 shown in FIG.32 can decodes an HQ audio ES.

Now, let us return to FIG. 30, where with a display device, output(display of a picture, output of audio) of contents recorded in theoptical disc 511 is performed based on the data (video data and audiodata) decoded by the decoder 656.

Also, the controller 651 is also connected with a drive 657 asnecessary, and the drive 657 is mounted with a removable medium 658, forexample, such as a magnetic disk (including a flexible disk), an opticaldisc (including CD-ROM (Compact Disk-Read Only Memory), and DVD), anmagneto-optical disk (including MD (registered trademark) (Mini-Disk))or semiconductor memory.

Next, description will be made regarding a method arranged to performspecial playback using an EP_map created by the processing shown in FIG.29 (created and recorded by the processing in step S315 shown in FIG.28). An EP_map is useful for performing random access playback.

Of transport streams of digital broadcasting, audio PIDs sometimeschange, so it is necessary for an AV decoder (the AV decoder 656 of theplayback apparatus 641 shown in FIG. 30) to know the PID mapping of therecorded transport streams. Therefore, an EP_map has an audio PID valuefor each sub table called EP_map_for_one_stream_PID( ) referred thereto,and also the ProgramInfo has information regarding the PID mapping.

FIG. 33 is a flowchart describing random access playback processing asto a BS audio ES. This processing is, for example, processing to beexecuted in the case of the playback apparatus 641 shown in FIG. 30including the AV decoder 656 shown in FIG. 31 playing a BS audio ES fromthe Clip (Clip AV stream file a Clip information file) recorded in theoptical disc 511 by the above-mentioned processing. That is to say, thisprocessing is executed in a case wherein the playback apparatus 641 canhandle a BS audio ES and a video ES alone (a case wherein the playbackapparatus 641 cannot handle an HQ audio ES), and also in a case ofperforming the random access playback of a BS audio ES. Also, thisprocessing is processing arranged to perform random access playback,i.e., start playback not from the top of the Clip AV stream filerecorded in the optical disc 511, but from the playback positioninstructed by the user. Note that this processing is started when theoptical disc 511 in which the Clip is recorded is mounted on theplayback apparatus 641 shown in FIG. 30 (playback apparatus includingthe AV decoder 656 shown in FIG. 31).

In step S411, the playback control unit 654 obtains an EP_map (e.g.,EP_map created in the processing shown in FIG. 29) from the Clipincluding the BS audio ES and the HQ audio ES recorded in the opticaldisc 511 based on the control from the controller 651. The playbackcontrol unit 654 supplies the obtained EP_map to the controller 651.

In step S412, the operation input unit 652 accepts a random accessplayback instruction from the user. The operation input unit 652supplies the signal corresponding to the received instruction to thecontroller 651. For example, the user instructs a playback position(entry point) with point-in-time (playback point-in-time on this AVstream) as a random access playback instruction, so the operation inputunit 652 supplies the signal corresponding to the point-in-time of theaccepted entry point to the controller 651. The entry point is, asdescribed with FIG. 29, set as to the predetermined BS audio TS packet.The controller 651 performs a predetermined calculation based on thesignal corresponding to the point-in-time supplied from the operationinput unit 652, and obtains a PTS. That is to say, the controller 651can convert the point-in-time (point-in-time on this AV stream)specified by the user into a PTS.

In step S413, the controller 651 obtains the source packet number andPTS value of the accepted entry point based on the obtained EP_map. Forexample, in FIG. 27, in the event that the position (point-in-time)indicated with the SPN_EP_start is accepted as an entry point, thecontroller 651 obtains SPN#1 that is the SPN_EP_start (i.e., the numberof the BS audio TS packet 311-1) as the source packet number of theentry point, and also obtains PTS#1 as the PTS value (PTS_EP_start)stored in the PES header of the PES packet extracted from the TS packet(the portion of the TS payload of the TS packet) including the BS audioTS packet 311-1.

In step S414, the controller 651 takes the readout position of the Clipincluding the BS audio ES and the HQ audio ES as the obtained sourcepacket number. For example, the controller 651 takes the obtained sourcepacket number SPN#1 (SPN_EP_start) as the readout position of the Clipof the optical disc 511. At this time, an entry point can be set as to aBS audio TS packet alone as described with FIG. 29, so the readoutposition of the optical disc 511 is set as to the BS audio TS packet.

In step S415, the playback control unit 654 reads out the TS packet ofthe BS audio ES having the source packet number thereof based on thecontrol from the controller 651, and supplies this to the first audiodecoder 656-1. For example, the playback control unit 654 reads out theTS packet of the BS audio ES having the source packet number SPN#1, andsupplies this to the first audio decoder 656-1 shown in FIG. 31.

In step S416, the first audio decoder 656-1 starts decoding from the TSpacket of the supplied BS audio ES. That is to say, playback is startedfrom the BS audio TS packet 311-1 (FIG. 27) having the source packetnumber SPN#1. The first audio decoder 656-1 having a configuration suchas FIG. 31 can decode a BS audio ES, so the TS packets of the BS audioES are sequentially read out, decoded and output. Playback of thesubsequent TS packets is the same as common playback, so the detaileddescription thereof will be omitted, but only the BS audio TS packetsare sequentially picked up, and decoded.

According to the processing shown in FIG. 33, the playback apparatus 641(FIG. 30) including the AV decoder 656 shown in FIG. 31, which canhandle a BS audio ES, can perform the random access playback of a BSaudio ES based on a random access playback instruction from the userwith reference to the EP_map.

Next, random access playback processing as to an HQ audio ES will bedescribed with reference to the flowchart shown in FIG. 34. Thisprocessing is processing to be executed in the case of the playbackapparatus 641 shown in FIG. 30 including the AV decoder 656 shown inFIG. 32 playing the HQ audio ES from the Clip (Clip AV stream file andClip information file) recorded in the optical disc 511 by theabove-mentioned processing. That is to say, this processing isprocessing to be executed in the case of the playback apparatus 641being capable of handling an HQ audio ES and a video ES, and also in thecase of performing the random access playback of an HQ audio ES. Also,this processing is processing arranged to perform random accessplayback, i.e., start playback not from the top of the Clip AV streamfile recorded in the optical disc 511, but from the playback positioninstructed by the user. Note that this processing is started when theoptical disc 511 in which the Clip is recorded is mounted on theplayback apparatus 641 shown in FIG. 30 (playback apparatus includingthe AV decoder 656 shown in FIG. 32).

In step S451, the playback control unit 654 obtains an EP_map (e.g.,EP_map created in the processing shown in FIG. 29) from the Clipincluding the BS audio ES and the HQ audio ES recorded in the opticaldisc 511 based on the control from the controller 651. The playbackcontrol unit 654 supplies the obtained EP_map to the controller 651.

In step S452, the operation input unit 652 accepts a random accessplayback instruction from the user. The operation input unit 652supplies the signal corresponding to the received instruction to thecontroller 651. For example, the user instructs a playback position(entry point) with point-in-time as a random access playbackinstruction, so the operation input unit 652 supplies the signalcorresponding to the point-in-time of the accepted entry point to thecontroller 651. The entry point is, as described with FIG. 29, set as tothe predetermined BS audio TS packet. That is to say, the playbackapparatus 641 including the AV decoder 656 shown in FIG. 32 can handlean HQ audio ES, so for example, in the case of the example shown in FIG.27, playback from the HQ audio TS packet 321-1 is requested, butobtained here is the entry point which is the BS audio TS packet 311-1.Therefore, with the subsequent processing, it is necessary to set areadout position as to the most appropriate HQ audio TS packet. Notethat the user can specify time (playback time) converted from a PTS asthe playback position of random access.

In step S453, the controller 651 obtains the source packet number andPTS value of the accepted entry point based on the obtained EP_map. Forexample, in FIG. 27, in the event that the position (point-in-time)indicated with the SPN_EP_start is accepted as an entry point, thecontroller 651 obtains SPN#1 that is the SP_EP_start (i.e., the numberof the BS audio TS packet 311-1) as the source packet number of theentry point, and also obtains PTS#1 as the PTS value (PTS_EP_start)stored in the PES header of the PES packet extracted from the TS packet(the portion of the TS payload of the TS packet) including the BS audioTS packet 311-1.

In step S454, the controller 651 takes the readout position of the Clipincluding the BS audio ES and the HQ audio ES as the obtained sourcepacket number. For example, the controller 651 takes the obtained sourcepacket number SPN#1 (SPN_EP_start) as the readout position of the Clipof the optical disc 511. At this time, an entry point can be set as to aBS audio TS packet alone as described with FIG. 29, so the readoutposition of the optical disc 511 is set as to the BS audio TS packet.

In step S455, the playback control unit 654 reads out the optical disc511 from the current readout position based on the control from thecontroller 651, and obtains the HQ audio TS packet recorded first afterthe readout position (after as recording time). For example, in theexample shown in FIG. 27, in the event of the readout position being setto the BS audio TS packet 311-1, the playback control unit 654 obtainsthe HQ audio TS packet 321-1 of which the source packet number is afterthe BS audio TS packet 311-1 (SPN#1), which is the first HQ audio TSpacket. The playback control unit 654 supplies the obtained HQ audio TSpacket 321-1 to the controller 651.

In step S456, the controller 651 determines whether or not the PTS valueof the PTS header included in the TS payload of the obtained HQ audio TSpacket is identical to the obtained PTS value. In the case of theexample shown in FIG. 27, the controller 651 determines whether or notthe PTS value of the PTS header 302-1 included in the TS payload of theobtained HQ audio TS packet 321-1 is identical to the PTS value (PTS#1)obtained at the processing in step S453. In the event that determinationis made that the PTS value corresponding to the obtained HQ audio TSpacket is not identical to the PTS value obtained at the processing instep S453, the processing returns to step S453, where the subsequentprocessing is repeated. For example, the HQ audio TS packet 321-2 (ofwhich the source socket number is after) recorded at the positionfurther after the HQ audio TS packet 321-1 read out now is obtained, andthe determination in step S456 is made regarding the obtained HQ audioTS packet 321-2. Note that one PES packet is made up of multiple TSpackets, so the HQ audio TS packet to be processed may include no PESheader in some cases. Therefore, for example, in the event that thepayload of the HQ audio TS packet includes no PES header but a PESpayload alone, the processing returns to step S455, where the next HQaudio TS packet is obtained, and the subsequent processing is repeated.

In the event that determination is made in step S456 that the PTS valuecorresponding to the obtained HQ audio TS packet is identical to the PTSvalue obtained at the processing in step S453, the controller 651 takesthe HQ audio TS packet thereof as a new readout position. Subsequently,the processing proceeds to step S457, where the playback control unit654 reads out the HQ audio TS packet of which the PTS value has beendetermined to be identical to the PTS value obtained at the processingin step S453 based on the control from the controller 651, and suppliesthis to the second audio decoder 656-5 shown in FIG. 32. That is to say,in the event that the PTS value corresponding to the obtained HQ audioTS packet 321-1 is identical to the PTS value obtained at the processingin step S453, the BS audio TS packet 311-1 and the HQ audio TS packet321-1 correspond to the same playback point-in-time. Therefore, theplayback control unit 654 starts playback from the position of the HQaudio TS packet 321-1 of which the PTS value has been determined to beidentical to the PTS value obtained at the processing in step S453.

In step S458, the second audio decoder 656-2 starts decoding from thesupplied HQ audio TS packet 321-1. That is to say, playback is startedfrom the HQ audio TS packet 321-1 having the same PTS#1 as the BS audioTS packet 311-1 (FIG. 27) serving as the entry point specified as theposition to be played. The second audio decoder 656-2 having aconfiguration such as FIG. 32 can decode an HQ audio ES, so the TSpackets of the HQ audio ES are sequentially read out, decoded andoutput. Playback of the subsequent TS packets is the same as commonplayback, so the detailed description thereof will be omitted, but onlythe HQ audio TS packets are sequentially picked up, and decoded.

As described with the processing in step S354 and step S355 in FIG. 29,an arrangement is made wherein an EP_map is created so as to include thedetailed information 276 (FIG. 11), i.e., information indicating adecoding start position in the HQ audio TS packet having the same PTS asthe BS audio TS packet serving as the entry point, so the second audiodecoder 656-2 can decode from the supplied HQ audio TS packet, wherebyplayback can be performed rapidly. If the detailed information 276 isnot included in the HQ audio TS packet thereof, it is necessary tosearch the HQ audio TS packet including the detailed information, andaccordingly, rapid playback of an HQ audio ES cannot be performed, butwith the present embodiment, in the event that the HQ audio TS packethaving the same PTS value as the PTS of a BS audio TS packet includesthe detailed information 276, the BS audio TS packet is taken as theentry point (processing in FIG. 29), whereby the HQ audio ES can berapidly played.

According to the processing in FIG. 34, the playback apparatus 641 (FIG.30) including the AV decoder 656 shown in FIG. 32, which can handle anHQ audio ES, can perform the random access playback of an HQ audio ES byreferring to the EP_map based on the random access playback instructionfrom the user.

Thus, in the event of multiplexing BS audio TS packets and HQ audio TSpackets, an arrangement is made wherein processing such as shown in FIG.18 through FIG. 22 is executed, multiplexing is performed so as tosatisfy the constraints at the time of PES packetizing, and themultiplexing constraints for random access, and with the optical disc511 in which the Clip AV stream file generated with the above-mentionedprocessing is recorded, an EP_map is created by the processing describedabove with reference to FIG. 29, whereby random access playback can beperformed based on the EP_map. That is to say, the multiplexingconstraints for random access shown in FIG. 22 are multiplexingconstraints arranged to create an EP_map shown in FIG. 29.

Also, in the event that audio data encoded with different encodingmethods is subjected to TS packetizing, and multiplexing, and recordedin an optical disc, there is an HQ audio TS packet having the same PTSvalue as the PTS of the TS packet of one audio stream (the TS packet ofa BS audio ES) that can be set as the entry point, with the TS, the HQaudio TS packet having the PTS value thereof is recorded so as to bedisposed after the BS audio TS packet having the PTS value thereof, theBS audio TS packet thereof is set as the entry point, thereby creatingan EP_map, so even in the event of playing the HQ audio ES correspondingto the position specified by the user, the HQ audio TS having the samePTS as the PTS of the BS audio TS packet serving as the entry point canbe read out, whereby random access playback of the HQ audio ES can beperformed.

Also, in the event that a BS audio TS packet and an HQ audio TS packethave the same PTS, and the HQ audio TS packet is disposed after the BSaudio TS packet, and further the detailed information 276 (FIG. 11) isrecorded in the HQ audio TS packet, an entry point is arranged to beset, and consequently, the detailed information 276 is always recordedin the HQ audio TS having the same PTS as the PTS of the BS audio TSpacket serving as the entry point, and accordingly, the HQ audio ES canbe rapidly played from the position thereof.

Note that in FIG. 33 and FIG. 34, description has been made regarding acase wherein the Clip recorded in the optical disc 511 (Clip AV streamfile and Clip information file) is played using an audio EP_map (EP_mapincluded in the recorded Clip thereof). Now, as for a case wherein anaudio EP_map is used, for example, in addition to a case wherein abrowser-able slide show is played, a case can be conceived wherein avideo stream recorded in another first recording medium (not shown)beforehand, and an audio stream downloaded via a network or anothersecond recording medium (second recording medium may be, for example,the optical disc 511 shown in FIG. 30) are played in a synchronizedmanner. In the event that a video stream recorded in another firstrecording medium beforehand, and an audio stream downloaded via anetwork or another second recording medium are played in a synchronizedmanner, a random access instruction from the user is accepted in stepS412 and step S452, and with the processing in step S413 and step S453,first a video EP_map (video EP_map recorded in another first recordingmedium beforehand) is referenced, the entry point of the audio streamsynchronized with the entry point of the video EP_map is obtained fromthe audio EP_map (EP_map corresponding to the downloaded audio), andnext the source packet number and PTS of the entry point is obtained, aswith the above-mentioned processing in step S413 and step S453.

Note that with the present embodiment, the recording apparatus 501 (FIG.23) and the playback apparatus 641 (FIG. 30) have been described asseparate apparatuses, but the present embodiment can be applied to arecording/playback apparatus into which those apparatuses areintegrated. In this case, consequently the above-mentioned recordingprocessing and playback processing are all executed by therecording/playback apparatus. Also, the sending apparatus 111 (FIG. 4)and the recording apparatus 501 (FIG. 23) may be integrated into oneapparatus.

Thus, in the event that a BS audio ES and an HQ audio ES which wereencoded with different encoding methods and generated are each subjectedto TS packetizing, and multiplexed into one transport stream, TS packetsto be multiplexed are arranged to be determined so as to satisfy themultiplexing constraints for random access, assuming the first virtualreceiving apparatus 120 including the first virtual decoder (the virtualdecoder 121 shown in FIG. 14 including the BS audio data decodingprocessing unit 360-1 shown in FIG. 15) which can handle a BS audio ESalone, and the second virtual receiving apparatus 120 including thesecond virtual decoder (the virtual decoder 121 shown in FIG. 14including the HQ audio data decoding processing unit 360-2 shown in FIG.15) which can handle an HQ audio ES, whereby decoding can be performedsmoothly regardless of a receiving apparatus capable of handling a BSaudio ES alone and a receiving apparatus capable of handling an HQ audioES.

That is to say, the sending apparatus 111 regulates (determines) TSpackets to be multiplexed while causing the transport buffer 362-1 to nooverflow, and while causing the elementary buffer 363-1 to neitheroverflow nor underflow, of the first virtual receiving apparatusincluding the first virtual decoder, and also regulates (determines) TSpackets to be multiplexed while causing the transport buffer 362-2 to nooverflow, while causing the elementary buffer 363-2 to neither overflownor underflow, while causing the FIFO buffer 391 to no underflow, of thesecond virtual receiving apparatus including the second virtual decoder,and further so as to satisfy the multiplexing constraints for randomaccess, whereby decoding can be performed smoothly regardless of areceiving apparatus capable of handling a BS audio ES alone and areceiving apparatus capable of handling an HQ audio ES.

Also, in the event of subjecting an HQ audio ES to PES packetizing, itis unnecessary for the PES-packetizing unit 136 to calculate a DTS,whereby the PES packetizing processing can be further performedsmoothly. Further, it is unnecessary for the PES-packetizing unit 136 tostore a DTS value in a PES packet to be generated, whereby the dataamount of PES packets can be suppressed. That is to say, the data amountof PES packets can be further reduced.

Note that the present invention is not restricted to the sendingapparatus 111 shown in FIG. 4, and rather can be applied to allmultiplexing apparatuses configured to multiplex the TS packets of anaudio stream (audio ES).

Also, with the above-mentioned examples, description has been maderegarding the order (timing) in the case of subjecting each of the BSaudio ES encoded with the first encoder 141, and the HQ audio ES encodedwith the second encoder 142 to TS packetizing, and multiplexing into onestream, but the present invention can be applied to another case as longas it is a case wherein an audio ES encoded with different encodingmethods are each subjected to TS packetizing, and multiplexing into onestream.

The above-mentioned series of processing can be realized with not onlyhardware but also software. In this case, the above-mentioned processingis executed by a personal computer 700 such as shown in FIG. 35.

In FIG. 35, a CPU 701 executes various types of processing in accordancewith a program stored in ROM 702, or a program loaded to RAM 703 from astorage unit 708. The RAM 703 also stores data necessary for the CPU 701executing various types of processing.

The CPU 701, ROM 702, and RAM 703 are mutually connected via an internalbus 704. This internal bus 704 is also connected with an input/outputinterface 705.

The input/output interface 705 is connected with an input unit 706 madeup of a keyboard, mouse, and the like, a display made up of a CRT, LCD,or the like, an output unit 707 made up of speakers and the like, astorage unit 708 made up of a hard disk and the like, and acommunication unit 709 made up of a modem, terminal adapter, or thelike. The communication unit 709 performs communication processing viavarious types of network including a phone line and CATV.

The input/output interface 705 is connected with a drive 710 asnecessary, on which a removable medium 721 made up of a magnetic disk,optical disc, magneto-optical disk, semiconductor memory, or the like ismounted as appropriate, and a computer program read out therefrom isinstalled into the storage unit 708 as necessary.

In the event of executing the series of processing using software, aprogram making up the software thereof is installed from a network orrecording medium.

This recording medium is, as shown in FIG. 35, made up of not only apackage medium made up of a removable medium 521 in which the program isrecorded, which is distributed to provide the program to a user apartfrom the computer, but also a hard disk or the like including the ROM702 and storage unit 708 in which the program is recorded, which isprovided a user in a state of being built in the apparatus main unitbeforehand.

Note that with the present Specification, the steps describing thecomputer program include not only processing to be processed serially inaccordance with the described order, but also processing to be executedin parallel or individually even if not necessarily processed serially.

1. A multiplexer configured to multiplex audio data as TS (Transport Stream) packets, comprising: first encoding means configured to encode said audio data using a first encoding method serving as a predetermined encoding method; second encoding means configured to encode said audio data using a second encoding method, which is a variable-length encoding method, and also differs from said first encoding method, arranged to add a timing value representing timing employed for a case of being decoded to each predetermined audio data unit; PES packetizing means configured to packetize said audio data encoded by said first encoding means, and said audio data encoded by said second encoding means to a PES packet, and also add point-in-time information employed for a case of being decoded to a plurality of said packetized PES packets; TS packetizing means configured to packetize said PES packet PES-packetized by said PES packetizing means to a TS packet, and also add the same ID to a plurality of said packetized TS packets; determining means configured to determine TS packets to be multiplexed from a plurality of said TS packets packetized by said TS packetizing means; and multiplexing means configured to multiplex said TS packets determined by said determining means; wherein said PES packetizing means packetize said audio data encoded by said first encoding means, and said audio data encoded by said second encoding means to a PES packet such that said audio data unit satisfying a predetermined cycle appears at the head of a PES payload; wherein said determining means is configured to assume a first virtual decoder configured to decode said audio data encoded by said first encoding means, and a second virtual decoder configured to decode said audio data encoded by said second encoding means based on said timing value added to said audio data encoded by said second encoding means, and also determine TS packets to be multiplexed based on multiplexing constraints arranged to randomly access said multiplexed TS packets; and wherein said determining means determine TS packets to be multiplexed from a plurality of said TS packets packetized by said TS packetizing means based on a first elementary buffer included in said first virtual decoder and a data transfer rate as to said first elementary buffer, and a second elementary buffer included in said second virtual decoder and a data transfer rate as to said second elementary buffer.
 2. The multiplexer according to claim 1, wherein said multiplexing constraints are constraints in which in the event that a TS includes a TS packet of audio data encoded by said second encoding means having the same point-in-time information as said point-in-time information included in a TS packet of audio data encoded by said first encoding means, the TS packet of the audio data encoded by said first encoding means is multiplexed prior to the TS packet of the audio data encoded by said second encoding means; and wherein said determining means determine TS packets to be multiplexed based on the assumptions of said first virtual decoder and said second virtual decoder, and said multiplexing constraints.
 3. A recording medium in which multiplexed TS (Transport Stream) packets are recorded, wherein a plurality of TS packets obtained by packetizing audio data encoded with a first encoding method serving as a predetermined encoding method to a plurality of PES packets, which are further packetized to a plurality of TS packets, and a plurality of TS packets obtained by packetizing audio data encoded with a second encoding method, which is a variable-length encoding method, and also differs from said first encoding method, arranged to add a timing value representing timing employed for a case of being decoded to each predetermined audio data unit to a plurality of PES packets, which are further packetized to a plurality of TS packets, are multiplexed and recorded; and wherein a plurality of said PES packets include point-in-time information employed for a case of being decoded, and also are obtained by said audio data encoded with said first encoding method, and said audio data encoded with said second encoding method being subjected to PES packetizing such that said audio data unit satisfying a predetermined cycle appears at the head of a PES payload; and wherein a plurality of said TS packets include a same ID, and also are TS packets obtained by assuming a first virtual decoder configured to decode said audio data encoded with said first encoding method, and a second virtual decoder configured to decode said audio data encoded with said second encoding method based on said timing value added to said audio data encoded with said second encoding method, and also determining TS packets to be multiplexed based on multiplexing constraints arranged to randomly access said multiplexed TS packets, wherein a TS packet to be multiplexed from among the plurality of TS packets packetized by a packetization mechanism on the basis of a first elementary buffer possessed by the first system target decoder and a rate at which data is transferred to be first elementary buffer and on the basis of a second elementary buffer possessed by the second system target decoder and a rate at which data is transferred to the second elementary buffer, said multiplexing constraints are constraints in which in the event that a TS includes a TS packet of audio data encoded in said second encoding method having a same point-in-time information as said point-in-time information included in a TS packet of audio data encoded in said first encoding method, the TS packet of the audio data encoded in said first encoding method is multiplexed prior to the TS packet of the audio data encoded by said second encoding method, and said TS packets are multiplexed based on the assumptions of said first virtual decoder and said second virtual decoder, and said multiplexing constraints. 